fix bug
This commit is contained in:
@@ -11,10 +11,17 @@ class Donation
|
||||
}
|
||||
$student_id = $GLOBALS['data']['data']['student_id'];
|
||||
|
||||
$lastIndex = lastIndex();
|
||||
if($lastIndex == 0){
|
||||
$where = "id > 0";
|
||||
}else{
|
||||
$where = "id < ".$lastIndex;
|
||||
}
|
||||
|
||||
$result = [];
|
||||
//查询用户信息
|
||||
$result['userinfo'] = [];
|
||||
$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();
|
||||
$userinfo = Db::name("student")->where("id",$student_id)->where($where)->field("id,nickname,identifier,avatar,age,type,disabled as is_disabled,city,school,hot,hot_count")->find();
|
||||
if(!empty($userinfo)){
|
||||
$result['userinfo'] = $userinfo;
|
||||
}
|
||||
@@ -23,12 +30,16 @@ class Donation
|
||||
$users = getAllUsersMessage($list,"user_id","id,nickname,avatar,shiyou_id");
|
||||
|
||||
foreach($list as $vo){
|
||||
$result['lastIndex'] = $vo['id'];
|
||||
$result['donation_list'][] = [
|
||||
"nickname"=>$users[$vo["user_id"]]['nickname'],
|
||||
"identity"=>empty($users[$vo["user_id"]]['shiyou_id'])?1:0,
|
||||
"amount"=>$vo['amount'],
|
||||
];
|
||||
}
|
||||
if(count($list)<env("PAGE_COUNT")){
|
||||
$result["lastIndex"] = 0;
|
||||
}
|
||||
return show("获取成功",SUCCESS_CODE,$result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user