From 7473193da68c0c7bb635415019d2d4ee98af9bac Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sun, 2 May 2021 04:56:05 +0800 Subject: [PATCH] modify --- Database/Base/BaseActiveRecord.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index 90786328..de233768 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -968,7 +968,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess */ public function offsetExists(mixed $offset): bool { - return isset($this->_attributes[$offset]); + return isset($this->_attributes[$offset]) || isset($this->_oldAttributes[$offset]); } /** @@ -997,7 +997,8 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess */ public function offsetUnset(mixed $offset) { - if (!isset($this->_attributes[$offset])) { + if (!isset($this->_attributes[$offset]) + && !isset($this->_oldAttributes[$offset])) { return; } unset($this->_attributes[$offset]);