Commit 24602535 authored by zw's avatar zw

Merge branch 'test'

parents ee957ddf 84ea06e7
...@@ -635,9 +635,12 @@ class UserService ...@@ -635,9 +635,12 @@ class UserService
/** /**
* 解除绑定关系 * 解除绑定关系
* @param $user_id * @param $now_user_id //当前详情页客户
* @return int|string * @param $user_id //被取消对象客户id
* @param $agent_id //当前操作经纪人id
* @return int
*/ */
public function removeUserBind($now_user_id,$user_id,$agent_id){ public function removeUserBind($now_user_id,$user_id,$agent_id){
// 检查权限 客方自己 有权限的人 // 检查权限 客方自己 有权限的人
$s_vip = new VipService(); $s_vip = new VipService();
...@@ -649,14 +652,25 @@ class UserService ...@@ -649,14 +652,25 @@ class UserService
return 2;//无解除关联权限权限 return 2;//无解除关联权限权限
} }
$now_user_info = $this->user->getUserById($field = 'bind_id', $now_user_id);
$params_['bind_id'] = 0; $params_['bind_id'] = 0;
$nuser_info = $this->user->getUserById($field = 'bind_id', $now_user_id); if($now_user_info['bind_id'] == 0){
if($nuser_info['bind_id'] == 0){ //当前客户详情 客户 为主账户的情况
$this->user->updateUsers($user_id,$params_); $this->user->updateUsers($user_id,$params_);
$this->userDoLog($now_user_id,$user_id,$agent_id);
}else{ }else{
$this->user->updateUsers($now_user_id,$params_); //当前客户详情 客户 为子账户的情况
$id = $user_id;
$this->userDoLog($now_user_id,$user_id,$agent_id);
if($now_user_info['bind_id'] == $user_id){
//如果要解绑的对象是 主账号 将当前页面客户bind_id 改 0
$id = $now_user_id;
$this->userDoLog($user_id,$now_user_id,$agent_id);
}
$this->user->updateUsers($id,$params_);
} }
$this->userDoLog($user_id,$now_user_id,$agent_id);
return 0; 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