From 6e30221cc1ab5e05449338fbdbf6bada9046019c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 4 Mar 2021 10:32:17 +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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index 10f454b8..4054fd4d 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -454,6 +454,8 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess $trance->commit(); $lastId = $this->setPrimary($lastId, $param); + $this->refresh(); + $this->event->dispatch(self::AFTER_SAVE, [$attributes, $param]); } catch (\Throwable $exception) { $trance->rollback(); @@ -519,6 +521,8 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess $trance->commit(); + $this->refresh(); + $this->event->dispatch(self::AFTER_SAVE, [$fields, $param]); return true;