From b59649d128e4b29a4ffc590197e3c3a3b3a984f2 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 30 Aug 2016 12:08:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BQuery=E7=B1=BB=E7=9A=84select?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 84f0edcb..35cb5dd4 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1855,7 +1855,8 @@ class Query $resultSet = false; if (empty($options['fetch_sql']) && !empty($options['cache'])) { // 判断查询缓存 - $cache = $options['cache']; + $cache = $options['cache']; + unset($options['cache']); $key = is_string($cache['key']) ? $cache['key'] : md5(serialize($options)); $resultSet = Cache::get($key); } @@ -1883,7 +1884,7 @@ class Query } // 返回结果处理 - if ($this->connection->getNumRows()) { + if (count($resultSet) > 0) { // 数据列表读取后的处理 if (!empty($this->model)) { // 生成模型对象