【操盘手】 选择好友支持筛选设备
This commit is contained in:
@@ -23,6 +23,12 @@ class GetFriendListV1Controller extends BaseController
|
||||
$page = $this->request->param('page',1);
|
||||
$limit = $this->request->param('limit',20);
|
||||
$keyword = $this->request->param('keyword','');
|
||||
$deviceIds = $this->request->param('deviceIds','');
|
||||
|
||||
if(!empty($deviceIds)){
|
||||
$deviceIds = explode(',',$deviceIds);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
$where = [];
|
||||
@@ -35,17 +41,22 @@ class GetFriendListV1Controller extends BaseController
|
||||
//$where[] = ['wf.userId','=',$this->getUserInfo('id')];
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!empty($keyword)){
|
||||
$where[] = ['wa1.nickname','like','%'.$keyword.'%'];
|
||||
}
|
||||
|
||||
if(!empty($deviceIds) && is_array($deviceIds)){
|
||||
$where[] = ['dw.deviceId','in',$deviceIds];
|
||||
}
|
||||
|
||||
|
||||
|
||||
$data = WechatFriendShipModel::alias('wf')
|
||||
->field(['wa1.nickname','wa1.avatar','wa1.alias','wf.id','wf.wechatId','wa2.nickname as ownerNickname','wa2.alias as ownerAlias','wa2.wechatId as ownerWechatId','wf.createTime'])
|
||||
->Join('wechat_account wa1','wf.wechatId = wa1.wechatId')
|
||||
->Join('wechat_account wa2','wf.ownerWechatId = wa2.wechatId')
|
||||
->join('device_wechat_login dw','wa2.wechatId = dw.wechatId')
|
||||
->where($where);
|
||||
|
||||
$total = $data->count();
|
||||
|
||||
Reference in New Issue
Block a user