mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 08:02:48 +08:00
改进模型的appendRelationAttr方法
This commit is contained in:
@@ -661,10 +661,11 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
|
|
||||||
$relation = Loader::parseName($relation, 1, false);
|
$relation = Loader::parseName($relation, 1, false);
|
||||||
|
|
||||||
|
// 获取关联数据
|
||||||
if (isset($this->relation[$relation])) {
|
if (isset($this->relation[$relation])) {
|
||||||
$model = $this->relation[$relation];
|
$model = $this->relation[$relation];
|
||||||
} else {
|
} else {
|
||||||
$model = $this->getAttr($relation);
|
$model = $this->getRelationData($this->$relation());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($model instanceof Model) {
|
if ($model instanceof Model) {
|
||||||
|
|||||||
Reference in New Issue
Block a user