改名
This commit is contained in:
@@ -864,14 +864,24 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
|||||||
return static::getColumns()->_decode($name, $value);
|
return static::getColumns()->_decode($name, $value);
|
||||||
}
|
}
|
||||||
if (in_array($name, $this->_with)) {
|
if (in_array($name, $this->_with)) {
|
||||||
|
return $this->with($name);
|
||||||
|
}
|
||||||
|
return parent::__get($name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $name
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
private function with($name): mixed
|
||||||
|
{
|
||||||
$data = $this->{$this->_relate[$name]}();
|
$data = $this->{$this->_relate[$name]}();
|
||||||
if ($data instanceof HasBase) {
|
if ($data instanceof HasBase) {
|
||||||
return $data->get();
|
return $data->get();
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
return parent::__get($name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user