Skip to content

Commit

Permalink
修正关联模型获取父对象判断
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Mar 19, 2023
1 parent eaf3c1d commit 8bc34a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/model/concern/RelationShip.php
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,9 @@ protected function isRelationAttr(string $attr)
protected function getRelationData(Relation $modelRelation)
{
if ($this->parent && !$modelRelation->isSelfRelation()
&& get_class($this->parent) == get_class($modelRelation->getModel())) {
&& get_class($this->parent) == get_class($modelRelation->getModel())
&& $modelRelation instanceof OneToOne
) {
return $this->parent;
}

Expand Down

0 comments on commit 8bc34a4

Please sign in to comment.