From 732ddff1791ea2b8381518050c8fd23088784bdd Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 1 Apr 2016 12:31:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BF=9D=E5=AD=98=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=20=E4=B8=BB=E9=94=AE=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/think/Model.php b/library/think/Model.php index 4d7bb3e2..109b3aa2 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -202,6 +202,7 @@ class Model if (!empty($this->data)) { // 没有传递数据,获取当前数据对象的值 $data = $this->data; + $find = true; // 重置数据 $this->data = []; } else { @@ -219,7 +220,7 @@ class Model if (empty($data)) { // 没有数据变化 return []; - } else { + } elseif (!empty($find)) { // 更新操作保留主键信息 $pk = $this->getPk(); if (is_array($pk)) {