Commit ef8ce24f authored by clone's avatar clone

解绑

parent 8d8a30c1
...@@ -27,6 +27,7 @@ use app\model\ABindingDevice; ...@@ -27,6 +27,7 @@ use app\model\ABindingDevice;
use app\model\Agents; use app\model\Agents;
use app\model\AStore; use app\model\AStore;
use app\model\Regions; use app\model\Regions;
use think\Exception;
use think\Session; use think\Session;
use think\Db; use think\Db;
...@@ -135,6 +136,38 @@ class Agent extends Basic ...@@ -135,6 +136,38 @@ class Agent extends Basic
} }
} }
/**
* 绑定或者解绑
* @return \think\Response
*/
public function updateDevice()
{
$params = $this->request->param();
/* $params = array(
"agent_id" => 1,//解绑或者绑定的经纪人id
"id" => 1, //关系id
"operator_id" => 12,//操作人id 登陆后台的经纪人id
"is_forbidden" => 0,//0正常 1禁止
);*/
$checkResult = $this->validate($params, "PerformanceValidate.verifyIsForbidden");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$aBD = new ABindingDevice();
try {
$id = $aBD->updateDevice($params);
if ($id > 0) {
return $this->response("200", "update success", [ "id" => $id ]);
} else {
return $this->response("101", "请求异常");
}
} catch (Exception $exception) {
return $this->response("101", "请求错误:" . $exception);
}
}
/** /**
* 新增or修改or查看 * 新增or修改or查看
* $group_id !=0为查看 * $group_id !=0为查看
......
...@@ -140,6 +140,7 @@ Route::group('index', [ ...@@ -140,6 +140,7 @@ Route::group('index', [
'updateStatus' => [ 'index/agent/updateStatus', [ 'method' => 'post' ] ], //状态修改【接口】 'updateStatus' => [ 'index/agent/updateStatus', [ 'method' => 'post' ] ], //状态修改【接口】
'updateRole' => [ 'index/agent/updateRole', [ 'method' => 'post' ] ], //经纪人角色修改【接口】 'updateRole' => [ 'index/agent/updateRole', [ 'method' => 'post' ] ], //经纪人角色修改【接口】
'deviceList' => [ 'index/agent/deviceList', [ 'method' => 'post|get' ] ], //经纪人设备id绑定列表 'deviceList' => [ 'index/agent/deviceList', [ 'method' => 'post|get' ] ], //经纪人设备id绑定列表
'updateDevice' => [ 'index/agent/updateDevice', [ 'method' => 'post|get' ] ],//解绑或绑定经纪人设备id
//客户标签 //客户标签
'getULabelsList' => [ 'index/label/getULabelsList', [ 'method' => 'get' ] ], //客户标签列表接口/界面 'getULabelsList' => [ 'index/label/getULabelsList', [ 'method' => 'get' ] ], //客户标签列表接口/界面
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment