From c917ad1ce92b5d627cd82bddbaefdb6c152d128d Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 14 Feb 2017 16:25:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BQuery=E7=B1=BB=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index cd5e9a2c..93b034b6 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -2302,7 +2302,7 @@ class Query } } - if (isset($cache)) { + if (isset($cache) && $resultSet) { // 缓存数据集 $this->cacheData($key, $resultSet, $cache); } @@ -2459,7 +2459,7 @@ class Query $result = isset($resultSet[0]) ? $resultSet[0] : null; } - if (isset($cache)) { + if (isset($cache) && $result) { // 缓存数据 $this->cacheData($key, $result, $cache); }