From b035692492283bec081cdfe8640148c48a339e9c Mon Sep 17 00:00:00 2001 From: knowpia <9812993@qq.com> Date: Wed, 14 Sep 2022 10:52:30 +0800 Subject: [PATCH] fix bug --- app/controller/Help.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/controller/Help.php b/app/controller/Help.php index 1289724..9951210 100644 --- a/app/controller/Help.php +++ b/app/controller/Help.php @@ -62,16 +62,23 @@ class Help } $student_id = $GLOBALS['data']['data']['student_id']; - $info = Db::name("student")->where("id",$student_id)->field("id")->find(); - if(empty($info)){ - return show("找不到该学生信息!"); - } $lastIndex = lastindex(); if($lastIndex == 0) { $lastIndex = 1; } $result = []; + + + $result['userinfo'] = []; + if($lastIndex==0) { + $userinfo = Db::name("student")->where("id", $student_id)->field("id,nickname,identifier,avatar,age,type,disabled as is_disabled,city,school,hot,hot_count")->find(); + if (!empty($userinfo)) { + $result['userinfo'] = $userinfo; + } + } + + $list = Db::name("appHelp")->where("student_id",$student_id)->limit(env("page_count"))->order('count desc')->paginate([ "list_rows"=>env("PAGE_COUNT"), "page"=>$lastIndex