|
@@ -14,11 +14,19 @@ class Userfollow extends Api
|
|
|
|
|
|
//我的关注列表
|
|
|
public function my_follow_list(){
|
|
|
+ $where_search = [];
|
|
|
+ $keyword = input('keyword','');
|
|
|
+ if(!empty($keyword)){
|
|
|
+ $where_search['user.u_id|user.nickname'] = $keyword;
|
|
|
+ }
|
|
|
+
|
|
|
$list = Db::name('user_follow')
|
|
|
->alias('follow')
|
|
|
->join('user','follow.follow_uid = user.id','LEFT')
|
|
|
->field('user.id,user.u_id,user.username,user.nickname,user.avatar,user.desc,user.gender,follow.createtime')
|
|
|
- ->where('follow.uid',$this->auth->id)->order('follow.id desc')->autopage()->select();
|
|
|
+ ->where('follow.uid',$this->auth->id)
|
|
|
+ ->where($where_search)
|
|
|
+ ->order('follow.id desc')->autopage()->select();
|
|
|
|
|
|
$list = list_domain_image($list,['avatar']);
|
|
|
|
|
@@ -35,11 +43,19 @@ class Userfollow extends Api
|
|
|
|
|
|
//我的粉丝列表
|
|
|
public function my_fans_list(){
|
|
|
+ $where_search = [];
|
|
|
+ $keyword = input('keyword','');
|
|
|
+ if(!empty($keyword)){
|
|
|
+ $where_search['user.u_id|user.nickname'] = $keyword;
|
|
|
+ }
|
|
|
+
|
|
|
$list = Db::name('user_follow')
|
|
|
->alias('follow')
|
|
|
->join('user','follow.uid = user.id','LEFT')
|
|
|
->field('user.id,user.u_id,user.username,user.nickname,user.avatar,user.desc,user.gender,follow.createtime')
|
|
|
- ->where('follow.follow_uid',$this->auth->id)->order('follow.id desc')->autopage()->select();
|
|
|
+ ->where('follow.follow_uid',$this->auth->id)
|
|
|
+ ->where($where_search)
|
|
|
+ ->order('follow.id desc')->autopage()->select();
|
|
|
|
|
|
$list = list_domain_image($list,['avatar']);
|
|
|
|
|
@@ -59,11 +75,19 @@ class Userfollow extends Api
|
|
|
|
|
|
//我的好友,拿粉丝列表改的
|
|
|
public function my_friend_list(){
|
|
|
+ $where_search = [];
|
|
|
+ $keyword = input('keyword','');
|
|
|
+ if(!empty($keyword)){
|
|
|
+ $where_search['user.u_id|user.nickname'] = $keyword;
|
|
|
+ }
|
|
|
+
|
|
|
$list = Db::name('user_follow')
|
|
|
->alias('follow')
|
|
|
->join('user','follow.uid = user.id','LEFT')
|
|
|
->field('user.id,user.u_id,user.username,user.nickname,user.avatar,user.desc,user.gender')
|
|
|
- ->where('follow.follow_uid',$this->auth->id)->order('follow.id desc')->autopage()->select();
|
|
|
+ ->where('follow.follow_uid',$this->auth->id)
|
|
|
+ ->where($where_search)
|
|
|
+ ->order('follow.id desc')->autopage()->select();
|
|
|
|
|
|
$list = list_domain_image($list,['avatar']);
|
|
|
|