...
|
...
|
@@ -168,14 +168,19 @@ class Order extends Api |
|
|
"msg": "成功",
|
|
|
"time": "1571492001",
|
|
|
"data": {
|
|
|
"id"://订阅ID
|
|
|
"user_id": //用户id,
|
|
|
"to_user_id"://订阅的用户id
|
|
|
"createtime"://创建时间
|
|
|
"username"://用户名
|
|
|
"avatar"://头像
|
|
|
"createtime"://创建时间
|
|
|
"updatetime"://修改时间
|
|
|
"list":[
|
|
|
{
|
|
|
"id"://订阅ID
|
|
|
"user_id": //用户id,
|
|
|
"to_user_id"://订阅的用户id
|
|
|
"createtime"://创建时间
|
|
|
"username"://用户名
|
|
|
"avatar"://头像
|
|
|
"createtime"://创建时间
|
|
|
"updatetime"://修改时间
|
|
|
}
|
|
|
]
|
|
|
"total_page"://总页数
|
|
|
}
|
|
|
})
|
|
|
*/
|
...
|
...
|
@@ -185,6 +190,12 @@ class Order extends Api |
|
|
$user_id = $this->auth->id;
|
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$pageNum = $this->request->param('pageNum', 10, 'intval');
|
|
|
$count = Db::name('subscribe')
|
|
|
->alias('a')
|
|
|
->join('user b','a.to_user_id = b.id')
|
|
|
->where('a.user_id',$user_id)
|
|
|
->order('a.id desc')
|
|
|
->count();
|
|
|
$data = Db::name('subscribe')
|
|
|
->alias('a')
|
|
|
->join('user b','a.to_user_id = b.id')
|
...
|
...
|
@@ -200,7 +211,15 @@ class Order extends Api |
|
|
$v['avatar'] = $qiniu.$v['avatar'];
|
|
|
}
|
|
|
}
|
|
|
$this->success('success',$data);
|
|
|
if($user_id == 15) {
|
|
|
$return = [
|
|
|
'list' => $data,
|
|
|
'total_page' => ceil($count/$pageNum)
|
|
|
];
|
|
|
} else {
|
|
|
$return = $data;
|
|
|
}
|
|
|
$this->success('success',$return);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|