if (isset($cache) && $resultSet) {
// 缓存数据集
$this->cacheData($key, $resultSet, $cache);
}
if (isset($cache) && (FALSE!==$resultSet)) {
// 缓存数据集
$this->cacheData($key, $resultSet, $cache);
}
if (empty($options['fetch_sql']) && !empty($options['cache'])) {
// 判断查询缓存
$cache = $options['cache'];
unset($options['cache']);
$key = is_string($cache['key']) ? $cache['key'] : md5(serialize($options));
$resultSet = Cache::get($key);
}
if (!$resultSet) { //<<<<<<<判断有问题<<<<<<<
// 生成查询SQL
$sql = $this->builder->select($options);
// 获取参数绑定
$bind = $this->getBind();
……
if (FALSE===$resultSet)
至此读写正常。
=======题外话=======
tp中,获取缓存数据成功则返回缓存数据,失败则返回false,注意缓存数据的empty判断