From f756bb804e2a8d3565b39a6fc8f769a6bd704391 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 22 Nov 2016 17:24:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 88c12e0d..a46bbed4 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1966,14 +1966,14 @@ class Query // 生成模型对象 $model = $this->model; foreach ($resultSet as $key => $result) { - $obj = new $model; - // 支持获取器 - $obj->data($result, true)->isUpdate(true); + /** @var Model $result */ + $result = new $model($result); + $result->isUpdate(true); // 关联查询 if (!empty($options['relation'])) { $result->relationQuery($options['relation']); } - $resultSet[$key] = $obj; + $resultSet[$key] = $result; } if (!empty($options['with']) && $result instanceof Model) { // 预载入