From 138f48498e000d5291160a1a77edc65ae4f00e92 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 23 Feb 2017 18:25:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BQuery=E7=B1=BBwith=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 2 +- library/think/model/relation/OneToOne.php | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) 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; }