mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进关联查询
This commit is contained in:
@@ -58,7 +58,10 @@ class MorphTo extends Relation
|
||||
// 主键数据
|
||||
$pk = $this->parent->$morphKey;
|
||||
$relationModel = (new $model)->relation($subRelation)->find($pk);
|
||||
$relationModel->setParent(clone $this->parent);
|
||||
|
||||
if ($relationModel) {
|
||||
$relationModel->setParent(clone $this->parent);
|
||||
}
|
||||
return $relationModel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user