|
|
|
@ -148,11 +148,12 @@ class Auth{
|
|
|
|
|
static $groups = array();
|
|
|
|
|
if (isset($groups[$uid]))
|
|
|
|
|
return $groups[$uid];
|
|
|
|
|
$user_groups = M()
|
|
|
|
|
->table($this->_config['AUTH_GROUP_ACCESS'] . ' a')
|
|
|
|
|
->where("a.uid='$uid' and g.status='1'")
|
|
|
|
|
->join($this->_config['AUTH_GROUP']." g on a.group_id=g.id")
|
|
|
|
|
->field('uid,group_id,title,rules')->select();
|
|
|
|
|
$user_base = M()->table($this->_config['AUTH_GROUP_ACCESS'])->where("uid = {$uid}")->field('uid,group_id')->find();
|
|
|
|
|
$user_rule= SM("auth_group","sys_")->where("id = {$user_base['group_id']} and status = 1")->field('title,rules')->find();
|
|
|
|
|
if(empty($user_base) || empty($user_rule)){
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
$user_groups = [array_merge($user_base,$user_rule)];
|
|
|
|
|
$groups[$uid]=$user_groups?:array();
|
|
|
|
|
return $groups[$uid];
|
|
|
|
|
}
|
|
|
|
|