修复群成员及好友数据展示问题
This commit is contained in:
@@ -22,15 +22,21 @@ class GetChatroomListV1Controller extends BaseController
|
|||||||
$keyword = $this->request->param('keyword', '');
|
$keyword = $this->request->param('keyword', '');
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$companyId = (int)$this->getUserInfo('companyId');
|
/*$companyId = (int)$this->getUserInfo('companyId');
|
||||||
$wechatIds = Db::name('device')->alias('d')
|
$wechatIds = Db::name('device')->alias('d')
|
||||||
// 仅关联每个设备在 device_wechat_login 中的最新一条记录
|
// 仅关联每个设备在 device_wechat_login 中的最新一条记录
|
||||||
->join('(SELECT MAX(id) AS id, deviceId FROM ck_device_wechat_login WHERE companyId='.$companyId.' GROUP BY deviceId) dwl_max','dwl_max.deviceId = d.id')
|
->join('(SELECT MAX(id) AS id, deviceId FROM ck_device_wechat_login WHERE companyId='.$companyId.' GROUP BY deviceId) dwl_max','dwl_max.deviceId = d.id')
|
||||||
->join('device_wechat_login dwl','dwl.id = dwl_max.id')
|
->join('device_wechat_login dwl','dwl.id = dwl_max.id')
|
||||||
->where(['d.companyId' => $companyId,'d.deleteTime' => 0])
|
->where(['d.companyId' => $companyId,'d.deleteTime' => 0])
|
||||||
|
->column('dwl.wechatId');*/
|
||||||
|
|
||||||
|
|
||||||
|
$wechatIds = Db::name('device')->alias('d')
|
||||||
|
->join('device_wechat_login dwl','dwl.deviceId=d.id AND dwl.companyId='.$this->getUserInfo('companyId'))
|
||||||
|
->where(['d.companyId' => $this->getUserInfo('companyId'),'d.deleteTime' => 0])
|
||||||
->column('dwl.wechatId');
|
->column('dwl.wechatId');
|
||||||
|
|
||||||
|
|
||||||
$where = [];
|
$where = [];
|
||||||
if ($this->getUserInfo('isAdmin') == 1) {
|
if ($this->getUserInfo('isAdmin') == 1) {
|
||||||
$where[] = ['g.deleteTime', '=', 0];
|
$where[] = ['g.deleteTime', '=', 0];
|
||||||
|
|||||||
@@ -42,12 +42,17 @@ class GetFriendListV1Controller extends BaseController
|
|||||||
$where[] = ['nickname|alias|wechatId','like','%'.$keyword.'%'];
|
$where[] = ['nickname|alias|wechatId','like','%'.$keyword.'%'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$companyId = (int)$this->getUserInfo('companyId');
|
|
||||||
$wechatIds = Db::name('device')->alias('d')
|
$wechatIds = Db::name('device')->alias('d')
|
||||||
|
->join('device_wechat_login dwl','dwl.deviceId=d.id AND dwl.companyId='.$this->getUserInfo('companyId'))
|
||||||
|
->where(['d.companyId' => $this->getUserInfo('companyId'),'d.deleteTime' => 0])->group('dwl.deviceId')->order('dwl.id desc');
|
||||||
|
|
||||||
|
|
||||||
|
/*$wechatIds = Db::name('device')->alias('d')
|
||||||
// 仅关联每个设备在 device_wechat_login 中的最新一条记录
|
// 仅关联每个设备在 device_wechat_login 中的最新一条记录
|
||||||
->join('(SELECT MAX(id) AS id, deviceId FROM ck_device_wechat_login WHERE companyId='.$companyId.' GROUP BY deviceId) dwl_max','dwl_max.deviceId = d.id')
|
->join('(SELECT MAX(id) AS id, deviceId FROM ck_device_wechat_login WHERE companyId='.$companyId.' GROUP BY deviceId) dwl_max','dwl_max.deviceId = d.id')
|
||||||
->join('device_wechat_login dwl','dwl.id = dwl_max.id')
|
->join('device_wechat_login dwl','dwl.id = dwl_max.id')
|
||||||
->where(['d.companyId' => $companyId,'d.deleteTime' => 0]);
|
->where(['d.companyId' => $companyId,'d.deleteTime' => 0]);*/
|
||||||
|
|
||||||
|
|
||||||
if (!empty($deviceIds)){
|
if (!empty($deviceIds)){
|
||||||
$wechatIds = $wechatIds->where('d.id','in',$deviceIds);
|
$wechatIds = $wechatIds->where('d.id','in',$deviceIds);
|
||||||
|
|||||||
Reference in New Issue
Block a user