From 79f64169be9475613b5e807a336cd02d9b6237b2 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 1 Jul 2016 09:45:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Query=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 49604ac0..39943d6b 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1820,7 +1820,7 @@ class Query if (empty($options['fetch_sql']) && !empty($options['cache'])) { // 判断查询缓存 $cache = $options['cache']; - if (true === $cache['key'] && !is_array($data)) { + if (true === $cache['key'] && !is_null($data) && !is_array($data)) { $key = 'think:' . $options['table'] . '|' . $data; } else { $key = is_string($cache['key']) ? $cache['key'] : md5(serialize($options));