mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
改进Query类缓存机制
This commit is contained in:
@@ -2302,7 +2302,7 @@ class Query
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($cache)) {
|
if (isset($cache) && $resultSet) {
|
||||||
// 缓存数据集
|
// 缓存数据集
|
||||||
$this->cacheData($key, $resultSet, $cache);
|
$this->cacheData($key, $resultSet, $cache);
|
||||||
}
|
}
|
||||||
@@ -2459,7 +2459,7 @@ class Query
|
|||||||
$result = isset($resultSet[0]) ? $resultSet[0] : null;
|
$result = isset($resultSet[0]) ? $resultSet[0] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($cache)) {
|
if (isset($cache) && $result) {
|
||||||
// 缓存数据
|
// 缓存数据
|
||||||
$this->cacheData($key, $result, $cache);
|
$this->cacheData($key, $result, $cache);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user