|
|
|
@ -325,12 +325,21 @@ class User extends BaseController |
|
|
|
|
*/ |
|
|
|
|
public function spread_list() |
|
|
|
|
{ |
|
|
|
|
[$level, $sort, $nickname] = $this->request->params(['level', 'sort', 'keyword'], true); |
|
|
|
|
$keyword = $this->request->param('keyword', ''); |
|
|
|
|
$uid = $this->request->uid(); |
|
|
|
|
$user = $this->user; |
|
|
|
|
[$page, $limit] = $this->getPage(); |
|
|
|
|
return app('json')->success($level == 2 |
|
|
|
|
? $this->repository->getTwoLevelList($uid, $nickname, $sort, $page, $limit) |
|
|
|
|
: $this->repository->getOneLevelList($uid, $nickname, $sort, $page, $limit)); |
|
|
|
|
|
|
|
|
|
$data = $this->repository->getOneLevelList($uid, $keyword, 'create_time', $page, $limit); |
|
|
|
|
$spread = $this->repository->get($user['spread_uid']); |
|
|
|
|
if($spread){ |
|
|
|
|
$data['spread'] = array('uid' => $spread['uid'], 'avatar' => $spread['avatar'], |
|
|
|
|
'nickname' => $spread['nickname'], 'phone' => $spread['phone']); |
|
|
|
|
}else{ |
|
|
|
|
$data['spread'] = null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return app('json')->success($data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|