From 35d57cfb5cdee70107ba6a54d9c2f4b310190440 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 14 Apr 2017 16:21:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E5=A4=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= 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 8ad8faf1..0eec1037 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1179,9 +1179,10 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $field = $value; $value = null; } + if (!isset($this->data[$field])) { $default = null; - } elseif (isset($this->origin[$field]) && $this->data[$field] === $this->origin[$field]) { + } else { $default = $this->data[$field]; }