mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
改进关联查询
This commit is contained in:
@@ -51,7 +51,10 @@ class HasOne extends OneToOne
|
||||
}
|
||||
// 判断关联类型执行查询
|
||||
$relationModel = $this->query->where($this->foreignKey, $this->parent->$localKey)->relation($subRelation)->find();
|
||||
$relationModel->setParent(clone $this->parent);
|
||||
|
||||
if ($relationModel) {
|
||||
$relationModel->setParent(clone $this->parent);
|
||||
}
|
||||
|
||||
return $relationModel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user