From dad13c505c295ab6a95710ad1125fe0cebe68d4d Mon Sep 17 00:00:00 2001 From: knowpia <9812993@qq.com> Date: Fri, 16 Sep 2022 13:35:52 +0800 Subject: [PATCH] fix bug --- app/controller/Donation.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controller/Donation.php b/app/controller/Donation.php index 7ac3a86..46ecb0b 100644 --- a/app/controller/Donation.php +++ b/app/controller/Donation.php @@ -63,10 +63,13 @@ class Donation $where = " id < ".$lastIndex; } $result['lastIndex'] = 0; + $result['total'] = 0; $result['list'] = []; - $list = Db::name("order")->where(['user_id'=>$userid,'status'=>1])->where($where)->order("id desc")->limit(env("page_count"))->select()->toArray(); - + $list = Db::name("order")->where(['user_id'=>$userid,'status'=>1])->where($where)->order("id desc")->limit(env("page_count"))->select(); + print_r($list); if(!empty($list)){ +// $result['total'] = $list->total(); + $list = $list->toArray(); $appUser = getAllUsersMessage($list,"user_id","id,nickname"); $studentUser = $this->getStudents($list); foreach ($list as $key => $vo) { @@ -76,6 +79,9 @@ class Donation "date"=> explode(" ",$vo['create_time'])[0], "student_nickname"=>$studentUser[$vo['student_id']]['nickname'], "donation_nickname"=>$appUser[$vo['user_id']]['nickname'], + "avatar"=>$studentUser[$vo['student_id']]['avatar'], + "type"=>$studentUser[$vo['student_id']]['type'], + "is_disabled"=>$studentUser[$vo['student_id']]['is_disabled'], ]; } if (count($list) < env("PAGE_COUNT")) { @@ -95,7 +101,7 @@ class Donation } $StudentIds = array_unique($StudentIds); $getAllStudentsMessage = []; - $UserLists = Db::name("student")->where("id", "IN",$StudentIds)->field("id,nickname")->select()->toArray(); + $UserLists = Db::name("student")->where("id", "IN",$StudentIds)->field("id,nickname,avatar,type,disabled as is_disabled")->select()->toArray(); foreach ($UserLists as $vo) { $getAllStudentsMessage[$vo['id']] = $vo; }