客服端 内容管理功能
This commit is contained in:
@@ -155,4 +155,34 @@ class GetDeviceDetailV1Controller extends BaseController
|
||||
return ResponseHelper::error($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function isUpdataWechat()
|
||||
{
|
||||
$id = $this->request->param('id/d');
|
||||
$companyId = $this->getUserInfo('companyId');
|
||||
$newWechat = DeviceWechatLoginModel::alias('a')
|
||||
->field('b.*')
|
||||
->join('wechat_account b', 'a.wechatId = b.wechatId')
|
||||
->where(['a.deviceId' => $id,'a.isTips' => 0,'a.companyId' => $companyId])
|
||||
->order('a.id', 'desc')
|
||||
->find();
|
||||
if (empty($newWechat)){
|
||||
return ResponseHelper::success('','该设备绑定的微信无需迁移',201);
|
||||
}
|
||||
|
||||
$oldWechat = DeviceWechatLoginModel::alias('a')
|
||||
->field('b.*')
|
||||
->join('wechat_account b', 'a.wechatId = b.wechatId')
|
||||
->where(['a.companyId' => $companyId])
|
||||
->where('a.deviceId' ,'<>', $id)
|
||||
->order('a.id', 'desc')
|
||||
->find();
|
||||
if (empty($oldWechat)){
|
||||
return ResponseHelper::success('','该设备绑定的微信无需迁移',201);
|
||||
}else{
|
||||
DeviceWechatLoginModel::where(['deviceId' => $id,'isTips' => 0,'companyId' => $companyId])->update(['isTips' => 1]);;
|
||||
return ResponseHelper::success(['newWechat' => $newWechat,'oldWechat' => $oldWechat]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user