This commit is contained in:
2021-03-04 15:35:51 +08:00
parent f97c55eecc
commit d50673765f
+1 -4
View File
@@ -58,8 +58,6 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
protected ?SEvent $event; protected ?SEvent $event;
/** @var array */ /** @var array */
protected array $_attributes = []; protected array $_attributes = [];
@@ -113,7 +111,6 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
} }
/** /**
* @param SEvent $event * @param SEvent $event
* 默认注入 * 默认注入
@@ -865,7 +862,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
if (array_key_exists($name, $this->_attributes)) { if (array_key_exists($name, $this->_attributes)) {
return static::getColumns()->_decode($name, $value); 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 $this->resolveClass($this->{$this->_relate[$name]}());
} }
return parent::__get($name); return parent::__get($name);