From 7576b88c99f5b2b58caa424e97aa69c741a2f197 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 11 May 2017 14:53:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=A8=A1=E5=9E=8B=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8F=98=E5=8C=96=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/think/Model.php b/library/think/Model.php index e92a9344..535d76a2 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1078,6 +1078,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess public function getChangedData() { $data = array_udiff_assoc($this->data, $this->origin, function ($a, $b) { + if ((empty($b) || empty($b)) && $a !== $b) { + return 1; + } return is_object($a) || $a != $b ? 1 : 0; });