修复微信管理数据展示问题
This commit is contained in:
@@ -71,14 +71,17 @@ class GetDeviceListV1Controller extends BaseController
|
||||
*/
|
||||
protected function getDeviceList(array $where): \think\Paginator
|
||||
{
|
||||
|
||||
$companyId = $this->getUserInfo('companyId');
|
||||
$query = DeviceModel::alias('d')
|
||||
->field([
|
||||
'd.id', 'd.imei', 'd.memo', 'd.alive',
|
||||
'l.wechatId',
|
||||
'a.nickname', 'a.alias', 'a.avatar', '0 totalFriend'
|
||||
])
|
||||
->leftJoin('device_wechat_login l', 'd.id = l.deviceId and l.alive =' . DeviceWechatLoginModel::ALIVE_WECHAT_ACTIVE . ' and l.companyId = d.companyId')
|
||||
->leftJoin('wechat_account a', 'l.wechatId = a.wechatId')
|
||||
->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 l','l.id = dwl_max.id')
|
||||
->join('wechat_account a', 'l.wechatId = a.wechatId')
|
||||
->order('d.id desc');
|
||||
|
||||
foreach ($where as $key => $value) {
|
||||
|
||||
Reference in New Issue
Block a user