diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 67619109..9089e6ca 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1895,7 +1895,7 @@ class Query $relation = Loader::parseName($relation, 1, false); $model = $class->$relation(); if ($model instanceof OneToOne && 0 == $model->getEagerlyType()) { - $model->eagerly($this, $relation, $subRelation, $closure, $first); + $model->removeOption()->eagerly($this, $relation, $subRelation, $closure, $first); $first = false; } elseif ($closure) { $with[$key] = $closure; diff --git a/library/think/model/relation/OneToOne.php b/library/think/model/relation/OneToOne.php index 8b602d59..52575589 100644 --- a/library/think/model/relation/OneToOne.php +++ b/library/think/model/relation/OneToOne.php @@ -194,9 +194,6 @@ abstract class OneToOne extends Relation */ public function getEagerlyType() { - if (0 == $this->eagerlyType) { - $this->removeOption(); - } return $this->eagerlyType; }