diff --git a/app/controller/Search.php b/app/controller/Search.php index 026937b..0babb3e 100644 --- a/app/controller/Search.php +++ b/app/controller/Search.php @@ -35,6 +35,8 @@ class Search $list = Db::name("student")->where($where)->order('hot desc')->limit(env("page_count"))->where($where)->select()->toArray(); $result = StudentToArray($list); + + return show(SUCCESS_MESSAGE.'!',SUCCESS_CODE,$result); } diff --git a/app/controller/Student.php b/app/controller/Student.php index ab550f6..c977763 100644 --- a/app/controller/Student.php +++ b/app/controller/Student.php @@ -44,14 +44,16 @@ class Student if (empty($list)) { return show("获取成功", SUCCESS_CODE, $result); } + + + $result = StudentToArray($list); + if ($list->currentPage() < $list->lastPage()) { $result['lastIndex'] = $lastIndex + 1; } else { $result['lastIndex'] = 0; } - - $result = StudentToArray($list); return show(SUCCESS_MESSAGE, SUCCESS_CODE, $result); }