From 5c1d516a65d56bf068d5f732278f75a0c4f2335b Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 6 Jul 2017 23:23:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=81=9A=E5=90=88=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=BF=94=E5=9B=9Enull=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 6c10f236..f18f38bc 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -415,8 +415,9 @@ class Query } $result = $pdo->fetchColumn(); if ($force) { - $result = is_numeric($result) ? $result + 0 : $result; + $result += 0; } + if (isset($cache)) { // 缓存数据 $this->cacheData($key, $result, $cache);