diff --git a/library/think/model/relation/MorphTo.php b/library/think/model/relation/MorphTo.php index 6c31a752..5fafd47a 100644 --- a/library/think/model/relation/MorphTo.php +++ b/library/think/model/relation/MorphTo.php @@ -114,6 +114,16 @@ class MorphTo extends Relation return $this; } + /** + * 移除关联查询参数 + * @access public + * @return $this + */ + public function removeOption() + { + return $this; + } + /** * 预载入关联查询 * @access public diff --git a/library/think/model/relation/OneToOne.php b/library/think/model/relation/OneToOne.php index c64dfcbb..8b602d59 100644 --- a/library/think/model/relation/OneToOne.php +++ b/library/think/model/relation/OneToOne.php @@ -194,7 +194,9 @@ abstract class OneToOne extends Relation */ public function getEagerlyType() { - $this->removeOption(); + if (0 == $this->eagerlyType) { + $this->removeOption(); + } return $this->eagerlyType; }