From 14e44291e49336b2179acac332acace4414c1fa9 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 17 Apr 2016 13:10:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Relation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/model/Relation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/model/Relation.php b/library/think/model/Relation.php index 9f0097eb..b711b0c5 100644 --- a/library/think/model/Relation.php +++ b/library/think/model/Relation.php @@ -112,7 +112,7 @@ class Relation case self::BELONGS_TO: foreach ($resultSet as $result) { // 模型关联组装 - $this->modelRelationBuild($model, $relation, $result); + $this->match($model, $relation, $result); } break; case self::HAS_MANY: @@ -126,7 +126,7 @@ class Relation } if (!empty($range)) { - $data = $this->modelRelationQuery($model, [$foreignKey => ['in', $range]], $relation, $subRelation); + $data = $this->eagerly($model, [$foreignKey => ['in', $range]], $relation, $subRelation); // 关联数据封装 foreach ($resultSet as $result) {