mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42: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);
|
||||
|
||||
// 获取关联数据
|
||||
if (isset($this->relation[$relation])) {
|
||||
$model = $this->relation[$relation];
|
||||
} else {
|
||||
$model = $this->getAttr($relation);
|
||||
$model = $this->getRelationData($this->$relation());
|
||||
}
|
||||
|
||||
if ($model instanceof Model) {
|
||||
|
||||
Reference in New Issue
Block a user