From 6025cc69c302aec615a75b4e35620147e70dc529 Mon Sep 17 00:00:00 2001 From: knowpia <9812993@qq.com> Date: Mon, 10 Oct 2022 08:55:51 +0800 Subject: [PATCH] fix bug --- app/controller/Search.php | 2 ++ app/controller/Student.php | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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); }