设备管理新增删除及头像
This commit is contained in:
@@ -9,6 +9,7 @@ use app\common\model\User as UserModel;
|
||||
use app\cunkebao\controller\BaseController;
|
||||
use library\ResponseHelper;
|
||||
use think\Db;
|
||||
use app\api\controller\DeviceController as apiDevice;
|
||||
|
||||
/**
|
||||
* 设备管理控制器
|
||||
@@ -83,11 +84,17 @@ class DeleteDeviceV1Controller extends BaseController
|
||||
*/
|
||||
protected function deleteCkbAbout(int $id): self
|
||||
{
|
||||
$this->deleteDevice($id);
|
||||
$this->deleteDeviceConf($id);
|
||||
$this->deleteDeviceUser($id);
|
||||
|
||||
return $this;
|
||||
$apiDevice = new ApiDevice();
|
||||
$res = $apiDevice->delDevice($id);
|
||||
$res = json_decode($res, true);
|
||||
if ($res['code'] == 200){
|
||||
$this->deleteDevice($id);
|
||||
$this->deleteDeviceConf($id);
|
||||
$this->deleteDeviceUser($id);
|
||||
return $this;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -75,7 +75,7 @@ class GetDeviceListV1Controller extends BaseController
|
||||
->field([
|
||||
'd.id', 'd.imei', 'd.memo', 'd.alive',
|
||||
'l.wechatId',
|
||||
'a.nickname', 'a.alias', '0 totalFriend'
|
||||
'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')
|
||||
|
||||
Reference in New Issue
Block a user