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);