Commit 6f91976f authored by hujun's avatar hujun

新增VIP权限

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