This commit is contained in:
xl
2024-08-08 10:52:48 +08:00
parent 08e49cfa65
commit 08fbc49091
+1 -1
View File
@@ -436,7 +436,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, \
private function insert(): bool|static private function insert(): bool|static
{ {
$sql = SqlBuilder::builder($query = static::query())->insert($this->_attributes); $sql = SqlBuilder::builder($query = static::query())->insert($this->_attributes);
$lastId = $this->getConnection()->createCommand($sql, $query->params)->save(); $lastId = $this->getConnection()->createCommand($sql, $query->params)->exec();
if ($lastId === false) { if ($lastId === false) {
return false; return false;
} }