diff --git a/src/db/PDOConnection.php b/src/db/PDOConnection.php index b442eea5..599b2848 100644 --- a/src/db/PDOConnection.php +++ b/src/db/PDOConnection.php @@ -1002,7 +1002,7 @@ public function insert(BaseQuery $query, bool $getLastInsID = false) if ($lastInsId) { $pk = $query->getAutoInc(); - if ($pk) { + if ($pk && is_string($pk)) { $data[$pk] = $lastInsId; } } @@ -1283,7 +1283,7 @@ public function value(BaseQuery $query, string $field, $default = null, bool $on * * @return mixed */ - public function aggregate(BaseQuery $query, string $aggregate, string|Raw $field, bool $force = false) + public function aggregate(BaseQuery $query, string $aggregate, string | Raw $field, bool $force = false) { if (is_string($field) && 0 === stripos($field, 'DISTINCT ')) { [$distinct, $field] = explode(' ', $field); @@ -1766,12 +1766,8 @@ public function getLastInsID(BaseQuery $query, string $sequence = null) protected function autoInsIDType(BaseQuery $query, string $insertId) { $pk = $query->getAutoInc(); - - if (is_array($pk)) { - return $insertId; - } - if ($pk) { + if ($pk && is_string($pk)) { $type = $this->getFieldsBind($query->getTable())[$pk]; if (self::PARAM_INT == $type) {