From 5af38b9bd0d59876087b845bc18360aa30c448e7 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 8 Apr 2016 16:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3isUpdate=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, 3 insertions(+), 3 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index b38d8b64..6ed60d50 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -363,8 +363,6 @@ abstract class Model implements \JsonSerializable, \ArrayAccess } $result = $db->update($this->data); - // 清空change - $this->change = []; // 更新回调 $this->trigger('after_update', $this); } else { @@ -393,6 +391,8 @@ abstract class Model implements \JsonSerializable, \ArrayAccess // 标记为更新 $this->isUpdate = true; + // 清空change + $this->change = []; return $result; } @@ -402,7 +402,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess * @param bool $update * @return Model */ - protected function isUpdate($update = true) + public function isUpdate($update = true) { $this->isUpdate = $update; return $this;