This commit is contained in:
knowpia
2022-10-10 08:58:03 +08:00
parent 6025cc69c3
commit f43cd34e11

View File

@@ -32,8 +32,26 @@ class Search
if($type == 3) $where .= " and disabled = 1";
}
$result = [];
// $list = Db::name("student")->where($where)->order('hot desc')->limit(env("page_count"))->where($where)->select()->toArray();
$list = Db::name("student")->where($where)->order('hot desc')->limit(env("page_count"))->paginate([
"list_rows" => env("PAGE_COUNT"),
"page" => $lastIndex
]);
if (empty($list)) {
return show("获取成功", SUCCESS_CODE, $result);
}
if ($list->currentPage() < $list->lastPage()) {
$result['lastIndex'] = $lastIndex + 1;
} else {
$result['lastIndex'] = 0;
}
$list = Db::name("student")->where($where)->order('hot desc')->limit(env("page_count"))->where($where)->select()->toArray();
$result = StudentToArray($list);