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 ($list->currentPage() < $list->lastPage()) { $result['lastIndex'] = $lastIndex + 1; } else { $result['lastIndex'] = 0; } $result = StudentToArray($list); return show(SUCCESS_MESSAGE, SUCCESS_CODE, $result); } /** * Notes : 获取学生的详情 * * @Date : 2022/9/9 16:41 * @Author : */ public function info() { $studentId = $GLOBALS['data']['data']['student_id']; $vo = \app\model\Student::find($studentId); $result = [ "id" => $vo['id'], "hot" => $vo['hot'], "avatar" => $vo['avatar'], "nickname" => $vo['nickname'], "is_disabled" => $vo['disabled'], "type" => $vo["type"], "identifier" => $vo['identifier'], "article_count" => $vo['article_count'], "city" => $vo['city'], "school" => $vo['school'], "age" => $vo['age'], ]; return show(SUCCESS_MESSAGE, SUCCESS_CODE, $result); } }