ranking-list

This commit is contained in:
2022-09-30 09:51:01 +08:00
parent 367e151ece
commit 597aaafccd

View File

@@ -1,4 +1,5 @@
<?php
namespace app\controller;
use think\facade\Db;
@@ -18,23 +19,36 @@ class Ranking
}
$where = [];
//1=未来之星;2=适龄儿童;3=残联儿童;4=全部
if($type == 1) $where = "type=1";
if($type == 2) $where = "type=2";
if($type == 3) $where = "disabled=1";
if($type == 4) $where = "";
if ($type == 1) {
$where = "type=1";
}
if ($type == 2) {
$where = "type=2";
}
if ($type == 3) {
$where = "disabled=1";
}
if ($type == 4) {
$where = "";
}
$lastIndex = lastindex();
if ($lastIndex == 0) {
$lastIndex = 1;
}
$result = [];
$list = Db::name("student")->where($where)->limit(env("page_count"))->order('hot desc')->paginate([
$list = Db::name("student")
->where($where)
// ->limit(env("page_count"))
->order('hot desc')
->paginate([
"list_rows" => env("PAGE_COUNT"),
"page" => $lastIndex
]);
if(empty($list)) return show("获取成功", SUCCESS_CODE,$result);
if (empty($list)) {
return show("获取成功", SUCCESS_CODE, $result);
}
if ($list->currentPage() < $list->lastPage()) {
$result['lastIndex'] = $lastIndex + 1;
} else {