Commit 17b39dd7 authored by hujun's avatar hujun

Merge remote-tracking branch 'origin/0702-v.2.2.0' into 0702-v.2.2.0

parents 8536b8fc 8fc109b8
...@@ -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, "VerifyValidate.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为查看
......
...@@ -13,18 +13,26 @@ class VerifyValidate extends Validate ...@@ -13,18 +13,26 @@ class VerifyValidate extends Validate
{ {
protected $rule = [ protected $rule = [
'id' => 'require|number', 'id' => 'require|number',
'phone' => 'require|number',
// 'wx_open_id' => 'require|length:10,50', 'device_id' => 'require',
// 'source' => 'require|number', 'is_forbidden' => 'require|in:0,1',
// 'user_id' => 'require|number|gt:0', 'operator_id' => 'require|number',
]; ];
protected $message = [ protected $message = [
'id.require' => 'id不能为空', 'id.require' => 'id不能为空',
'phone.require' => '手机号不能为空',
'phone.number' => '手机号输入错误',
'device_id.require' => '设备号获取失败,请联系管理员',
'is_forbidden.require' => '是否绑定字段必填',
'is_forbidden.in' => '是否绑定字段值只能为0或1',
'operator_id.require' => '操作人为必填字段',
'operator_id.number' => '操作人编号只能为数字',
]; ];
protected $scene = [ protected $scene = [
'select' => [ 'id' ], 'select' => [ 'id' ],
'verifyIsForbidden' => [ 'phone', 'device_id', 'is_forbidden', 'operator_id' ],
]; ];
} }
\ No newline at end of file
...@@ -139,7 +139,8 @@ Route::group('index', [ ...@@ -139,7 +139,8 @@ Route::group('index', [
'saveAgent' => [ 'index/agent/saveAgent', [ 'method' => 'get|post' ] ], //修改经纪人【接口】 'saveAgent' => [ 'index/agent/saveAgent', [ 'method' => 'get|post' ] ], //修改经纪人【接口】
'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' ] ], //客户标签列表接口/界面
...@@ -374,10 +375,10 @@ Route::group('broker', [ ...@@ -374,10 +375,10 @@ Route::group('broker', [
'statusBargain' => [ 'api_broker/OrderLog/statusBargain', [ 'method' => 'get|post' ] ], 'statusBargain' => [ 'api_broker/OrderLog/statusBargain', [ 'method' => 'get|post' ] ],
'getIsAccountStatement' => [ 'api_broker/OrderLog/getIsAccountStatement', [ 'method' => 'get|post' ] ], 'getIsAccountStatement' => [ 'api_broker/OrderLog/getIsAccountStatement', [ 'method' => 'get|post' ] ],
'login' => [ 'api_broker/Broker/login', [ 'method' => 'post' ] ], //经纪人登陆 废弃 'login' => [ 'api_broker/Broker/login', [ 'method' => 'post' ] ], //经纪人登陆 废弃
'loginV2' => [ 'api_broker/Broker/loginV2', [ 'method' => 'post' ] ], //经纪人登陆 'loginV2' => [ 'api_broker/Broker/loginV2', [ 'method' => 'post' ] ], //经纪人登陆
'verifyAgentStatus' => [ 'api_broker/Broker/verifyAgentStatus', [ 'method' => 'post' ] ], //判断经纪人是否被解绑 'verifyAgentStatus' => [ 'api_broker/Broker/verifyAgentStatus', [ 'method' => 'post' ] ], //判断经纪人是否被解绑
'updateDevice' => [ 'api_broker/Broker/updateDevice', [ 'method' => 'post' ] ], //解绑或者绑定经纪人 'updateDevice' => [ 'api_broker/Broker/updateDevice', [ 'method' => 'post' ] ], //解绑或者绑定经纪人
'editAgent' => [ 'api_broker/Broker/editAgent', [ 'method' => 'post' ] ], //经纪人修改密码 'editAgent' => [ 'api_broker/Broker/editAgent', [ 'method' => 'post' ] ], //经纪人修改密码
'forgetPwd' => [ 'api_broker/Broker/forgetPwd', [ 'method' => 'post' ] ], //经纪人忘记密码 'forgetPwd' => [ 'api_broker/Broker/forgetPwd', [ 'method' => 'post' ] ], //经纪人忘记密码
......
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