Commit 6ac71584 authored by zhuwei's avatar zhuwei

1

parent d60b871f
......@@ -859,6 +859,7 @@ class UserService
*/
public function addUserBindType($user_id,$bind_id)
{
$redis_service = new RedisCacheService();
$user_bind_type = $this->user->getUserByWhereValue('bind_type', ['id'=>$user_id]);
if(($user_bind_type == 1)or($user_bind_type == 2)){
//当前客户设置过原盘 新增默认为重盘
......@@ -867,6 +868,7 @@ class UserService
//当前客户未设原盘 新增默认为未设置
$this->user->updateUsers($bind_id, ['bind_type'=>0]);
}
$redis_service->userCache($bind_id);
return true;
}
......@@ -905,6 +907,8 @@ class UserService
return 2;//无解除关联权限权限
}
$this->removeUserBindType($user_id);//原盘重盘重置
$now_user_info = $this->user->getUserById($field = 'bind_id', $now_user_id);
$params_['bind_id'] = 0;
......@@ -924,7 +928,6 @@ class UserService
}
$this->user->updateUsers($id,$params_);
}
$this->removeUserBindType($user_id);//原盘重盘重置
$redis_service = new RedisCacheService();
$redis_service->userCache($user_id);
$redis_service->userCache($now_user_id);
......@@ -1061,20 +1064,21 @@ class UserService
*/
public function removeUserBindType($user_id)
{
$redis_service = new RedisCacheService();
$user_bind_type = $this->user->getUserByWhereValue('bind_type', ['id'=>$user_id]);
if($user_bind_type == 1){
//当前用户是原盘的还原全部设置
$s_user_call = new UserCallStintService();
$user_list = $s_user_call->getUserBindList($user_id);
if(!$user_list or (count($user_list) < 2)){
return false;
}
foreach($user_list as $k => $v) {
$this->user->updateUsers($v, ['bind_type'=>0]);
$redis_service->userCache($v);
}
}else{
//
$this->user->updateUsers($user_id, ['bind_type'=>0]);
$redis_service->userCache($user_id);
}
return true;
}
......
......@@ -1057,6 +1057,9 @@ class Users extends Model
/**
* 更新数据
* @param $id
* @param $params
* @return int|string
*/
public function updateUsers($id,$params)
{
......
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