diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index 584a2153..f2511b17 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -415,7 +415,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess throw new Exception('保存失败.' . $sqlBuilder); } $trance->commit(); - $this->setPrimary($lastId, $param); + $this->setPrimary($lastId = (int)$lastId, $param); $this->event->dispatch(self::AFTER_SAVE, [$attributes, $param]); } catch (\Throwable $exception) {