Commit 93e082a8 authored by zhuwei's avatar zhuwei

客户关联解绑

parent bd4c3831
...@@ -571,48 +571,35 @@ class Member extends Basic{ ...@@ -571,48 +571,35 @@ class Member extends Basic{
} }
public function ceshi() /**
* 客户关联解绑
* @return \think\Response
*/
public function removeUserBind()
{ {
$s = new UserService(); if (empty($this->params['user_id'])) {
//查询 return $this->response(101, '参数错误');
$user_info_list = $s->userBindInfo(1); }
return $this->response("200", "成功",$user_info_list);
//新增
// $user_id = 3;
// $bind_id = 1;
// $add_res = $s->addUserBind($user_id,$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", "绑定失败");
//
// }
//解除 //解除
// $rm_res = $s->removeUserBind($user_id); $s_index_user = new UserService();
// if($rm_res == 1){ $rm_res = $s_index_user->removeUserBind($this->params['user_id'],$this->userId);
// return $this->response("200", "解绑成功"); switch ($rm_res) {
// }else{ case 1 :
// return $this->response("200", "解绑失败"); 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", "解绑失败");
}
} }
} }
...@@ -568,12 +568,12 @@ class UserService ...@@ -568,12 +568,12 @@ class UserService
//0:有权限 1:无权限 //0:有权限 1:无权限
$is_can_edit = $s_vip->vip($agent_id,'addAgentsBlackList'); $is_can_edit = $s_vip->vip($agent_id,'addAgentsBlackList');
if ($is_can_edit == 1) { if ($is_can_edit == 1) {
return 1;//无解除关联权限权限 return 2;//无解除关联权限权限
} }
// 客户bind_id不等于0才能解绑并记录日志 // 客户bind_id不等于0才能解绑并记录日志
$user_info = $this->user->getUserById($field = 'bind_id', $user_id); $user_info = $this->user->getUserById($field = 'bind_id', $user_id);
if($user_info['bind_id'] == 0){ if($user_info['bind_id'] == 0){
return 2; return 3;
}else{ }else{
// 解绑操作记录 // 解绑操作记录
$this->userDoLog($user_id,$user_info['bind_id'],$agent_id); $this->userDoLog($user_id,$user_info['bind_id'],$agent_id);
...@@ -581,7 +581,7 @@ class UserService ...@@ -581,7 +581,7 @@ class UserService
$params_['bind_id'] = 0; $params_['bind_id'] = 0;
$res = $this->user->updateUsers($user_id,$params_); $res = $this->user->updateUsers($user_id,$params_);
return $res; return 0;
} }
/** /**
......
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