Commit 6f91976f authored by hujun's avatar hujun

新增VIP权限

parent 580b1068
...@@ -97,7 +97,7 @@ class Client extends Basic ...@@ -97,7 +97,7 @@ class Client extends Basic
$this->msg = '此号码为虚拟号码';break; $this->msg = '此号码为虚拟号码';break;
case -3 : case -3 :
$this->code = 101; $this->code = 101;
$this->msg = '没有权限';break; $this->msg = '没有新增VIP权限';break;
} }
} else { } else {
......
...@@ -14,42 +14,34 @@ use app\model\AuthRule; ...@@ -14,42 +14,34 @@ use app\model\AuthRule;
*/ */
class VipService class VipService
{ {
/** /**
* 是否具有查看vip客户权限 * 是否具有查看vip客户权限
* @param $id int 经纪人ID *
* @param $id 经纪人ID
* @param string $name
* @return int 是否可以查看vip客户 0:可查看 1:不可查看 * @return int 是否可以查看vip客户 0:可查看 1:不可查看
*/ */
public function vip($id) public function vip($id, $name = 'auth_vip')
{ {
//$id= 5743; //$id= 5743;
$agent = new AAgents(); $agent = new AAgents();
$fields = 'auth_group_id'; $fields = 'auth_group_id';
$auth_group_id = $agent->getAgentsById($id, $fields); $auth_group_id = $agent->getAgentsById($id, $fields);
$auth_group = New AuthGroup(); $auth_group = New AuthGroup();
$id = $auth_group_id; $id = $auth_group_id;
$fields = 'rules'; $fields = 'rules';
$rules = $auth_group->getAuthGroupById($id, $fields); $rules = $auth_group->getAuthGroupById($id, $fields);
$auth_group = New AuthRule(); $auth_group = New AuthRule();
$name = 'auth_vip';
$fields = 'id'; $fields = 'id';
$auth_rule_id = $auth_group->getAuthRuleByName($name, $fields); $auth_rule_id = $auth_group->getAuthRuleByName($name, $fields);
$rules_arr = explode(',', $rules); $rules_arr = explode(',', $rules);
//dump($rules_arr);
if (in_array($auth_rule_id, $rules_arr)) { if (in_array($auth_rule_id, $rules_arr)) {
return 0; return 0;
} else { } else {
return 1; return 1;
} }
} }
} }
\ No newline at end of file
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