Commit e3e2c583 authored by zw's avatar zw

Merge branch 'test'

parents a6712be3 6c8f53d8
......@@ -56,7 +56,7 @@ class Version extends Basic
$this->response("101","请求的设备类型不能为空");
}
$versionResult = $this->appVersion->getVersion($type);
$versionResult["is_show_wx"] = 1; //0显示 1不显示
$versionResult["is_show_wx"] = 0; //0显示 1不显示
return $this->response("200", "request success", $versionResult);
}
}
\ No newline at end of file
......@@ -620,6 +620,12 @@ class UserService
// 客户bind_id不等于0才能解绑并记录日志
$user_info = $this->user->getUserById($field = 'bind_id', $user_id);
if($user_info['bind_id'] == 0){
$band_count = $this->user->getUserCountByBandId($field = 'id', $user_id);
if($band_count == 1){
$params_['bind_id'] = 0;
$this->user->updateUsers($now_user_id,$params_);
return 0;
}
return 3;
}else{
// 解绑操作记录
......@@ -627,7 +633,7 @@ class UserService
}
$params_['bind_id'] = 0;
$res = $this->user->updateUsers($user_id,$params_);
$this->user->updateUsers($user_id,$params_);
return 0;
}
......
......@@ -740,6 +740,14 @@ class Users extends Model
->find();
}
public function getUserCountByBandId($field = '*', $bind_id, $where = '')
{
return $this->field($field)
->where('bind_id', $bind_id)
->where($where)
->count();
}
public function getAgentByUserId($field, $params)
{
return Db::name($this->table)
......
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