Commit f8cf09d8 authored by zhuwei's avatar zhuwei

addUserBind

parent 1af82aca
...@@ -854,5 +854,73 @@ class User extends Basic ...@@ -854,5 +854,73 @@ class User extends Basic
} }
/**
* 新增关联客户
* @return \think\Response
*/
public function addUserBind()
{
if (empty($this->params['user_id']) OR empty($this->params['bind_id'])) {
return $this->response(101, '参数错误');
}
$s_index_user = new UserService();
//新增
$add_res = $s_index_user->addUserBind($this->params['user_id'],$this->params['bind_id']);
switch ($add_res) {
case 1 :
return $this->response("300", "参数不全");
break;
case 2 :
return $this->response("300", "当前客户已经存在绑定关系");
break;
case 3 :
return $this->response("300", "当前客户已经存在绑定关系");
break;
case 4 :
return $this->response("300", "绑定客户关系数超限");
break;
case 5 :
return $this->response("300", "绑定失败");
break;
case 0 :
return $this->response("200", "绑定成功");
break;
default :
return $this->response("300", "绑定失败");
}
}
/**
* 客户关联解绑
* @return \think\Response
*/
public function removeUserBind()
{
if (empty($this->params['user_id'])) {
return $this->response(101, '参数错误');
}
//解除
$s_index_user = new UserService();
$rm_res = $s_index_user->removeUserBind($this->params['user_id'],$this->agentId);
switch ($rm_res) {
case 1 :
return $this->response("300", "操作人不是客方");
break;
case 2 :
return $this->response("300", "无解除关联权限权限");
break;
case 3 :
return $this->response("300", "主账号不允许此操作!");
break;
case 0 :
return $this->response("200", "解绑成功");
break;
default :
return $this->response("300", "解绑失败");
}
}
} }
\ No newline at end of file
...@@ -764,6 +764,8 @@ Route::group('broker', [ ...@@ -764,6 +764,8 @@ Route::group('broker', [
'followUpLog' => [ 'api_broker/User/followUpLog', [ 'method' => 'get|post' ] ],// 'followUpLog' => [ 'api_broker/User/followUpLog', [ 'method' => 'get|post' ] ],//
'userDetailFull' => [ 'api_broker/User/userDetailFull', [ 'method' => 'get|post' ] ],// 'userDetailFull' => [ 'api_broker/User/userDetailFull', [ 'method' => 'get|post' ] ],//
'addUserBind' => [ 'api_broker/User/addUserBind', [ 'method' => 'get|post' ] ],
'removeUserBind' => [ 'api_broker/User/removeUserBind', [ 'method' => 'get|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