From 75e79915f704d2b95ffd55299a6396164ca1ea72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Feb 2021 18:10:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/Base/BaseActiveRecord.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {