改进Query类分页方法

This commit is contained in:
thinkphp
2016-09-26 16:17:36 +08:00
parent fc8f05abc9
commit ddb1d702e9

View File

@@ -1009,9 +1009,11 @@ class Query
$total = $this->count();
$bind = $this->bind;
$results = $this->options($options)->bind($bind)->page($page, $listRows)->select();
} else {
} elseif ($simple) {
$results = $this->limit(($page - 1) * $listRows, $listRows + 1)->select();
$total = isset($total) ? $total : null;
$total = null;
} else {
$results = $this->page($page, $listRows)->select();
}
return $class::make($results, $listRows, $page, $total, $simple, $config);
}