改进查询缓存

This commit is contained in:
thinkphp
2018-01-20 18:06:34 +08:00
parent 430607bc61
commit 69326f050f

View File

@@ -2355,7 +2355,7 @@ class Query
}
}
if (isset($cache) && false !== $resultSet) {
if (isset($cache) && $resultSet) {
// 缓存数据集
$this->cacheData($key, $resultSet, $cache);
}
@@ -2513,7 +2513,7 @@ class Query
$result = isset($resultSet[0]) ? $resultSet[0] : null;
}
if (isset($cache) && false !== $result) {
if (isset($cache) && $result) {
// 缓存数据
$this->cacheData($key, $result, $cache);
}