From 1bc5e49b422250975b63e26d7403e6b2e0e746e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 21 Sep 2022 14:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Base/Model.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Base/Model.php b/Base/Model.php index a0eedd1..09364bd 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -662,7 +662,11 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T $assoc = array_diff_assoc($this->_attributes, $this->_oldAttributes); $uassoc = array_intersect_assoc($this->_attributes, $this->_oldAttributes); - + foreach ($assoc as $key => $item) { + if ($item === null) { + unset($assoc[$key]); + } + } return [$assoc, $uassoc, array_keys($assoc)]; }