Commit 39bda914 authored by zhuwei's avatar zhuwei

好友邀请分页

parent c87343ce
......@@ -399,19 +399,25 @@ class Member extends Basic
* @throws \think\exception\DbException
*/
public function inviteList() {
// $id = $this->params['id'];
// if (empty($id)) {
//$id = $this->params['id'];
//if (empty($id)) {
$id = $this->userId;
// }
//$id = 5741;
//}
$data['status'] = 101;
$data['data'] = array();
$data['msg'] = '';
if ($id) {
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$result = $this->user->field('id,user_nick,user_phone,create_time')
->where('referrer_id',$id)
->where('status',0)
->order('create_time desc')
->limit($pageSize)
->page($pageNo)
->select();
$data_arr = [];
foreach ($result as $k=>$v) {
......@@ -420,8 +426,14 @@ class Member extends Basic
$data_arr[$k]['user_phone'] = hide_customer_phone($arr['user_phone']);
$data_arr[$k]['create_time'] = date('Y-m-d', strtotime($arr['create_time']));
}
$data['data'] = $data_arr;
$data['status'] = 200;
$data['data']['list'] = $data_arr;
$data['status'] = 200;
$data['data']['total'] = $this->user->field('id,user_nick,user_phone,create_time')
->where('referrer_id',$id)
->where('status',0)
->order('create_time desc')
->count();
} else {
$data['msg'] = 'id is null';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment