Query类分页查询方法增加total_cache参数配置

This commit is contained in:
thinkphp
2017-05-15 16:45:20 +08:00
parent 13a5a3d9b6
commit 6a550b8cb8

View File

@@ -1336,7 +1336,8 @@ class Query
unset($this->options['order'], $this->options['limit'], $this->options['page'], $this->options['field']);
$bind = $this->bind;
$total = $this->count();
$cache = !empty($config['total_cache']) ? $config['total_cache'] : false;
$total = $this->cache($cache)->count();
$results = $this->options($options)->bind($bind)->page($page, $listRows)->select();
} elseif ($simple) {
$results = $this->limit(($page - 1) * $listRows, $listRows + 1)->select();