From d50673765fe1921e7aa34eae4354e006c118f7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 4 Mar 2021 15:35:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/Base/BaseActiveRecord.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index e1c1a92e..4603c35f 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -58,8 +58,6 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess protected ?SEvent $event; - - /** @var array */ protected array $_attributes = []; @@ -113,7 +111,6 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess } - /** * @param SEvent $event * 默认注入 @@ -865,7 +862,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess if (array_key_exists($name, $this->_attributes)) { return static::getColumns()->_decode($name, $value); } - if (isset($this->_with[$name])) { + if (in_array($name, $this->_with)) { return $this->resolveClass($this->{$this->_relate[$name]}()); } return parent::__get($name);