From fc828df683bf609b0196f166c6fdbe91d5e2d310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 21 Sep 2022 14:40:24 +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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Base/Model.php b/Base/Model.php index 09364bd..ef8d0cf 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -661,9 +661,12 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T { $assoc = array_diff_assoc($this->_attributes, $this->_oldAttributes); + $column = $this->getColumns(); + $uassoc = array_intersect_assoc($this->_attributes, $this->_oldAttributes); foreach ($assoc as $key => $item) { - if ($item === null) { + $encode = $column->get_fields($key); + if ($column->isString($encode) && $item === null) { unset($assoc[$key]); } }