From a0f1a7f4364eea23bb68c8c29e7086bbfbc62f5b Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 17 Jun 2016 12:04:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BModel=E7=B1=BB=E7=9A=84save?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index 31caed62..e1b25b46 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -615,13 +615,15 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $result = $insertId; } // 标记为更新 - $this->isUpdate = true; + $this->isUpdate = true; + // 清空change + $this->change = []; // 新增回调 $this->trigger('after_insert', $this); } // 写入回调 $this->trigger('after_write', $this); - + return $result; }