修复超级管理员无法在列表查看超级管理员的BUG

pull/28/head
Karson 2017-12-06 17:50:23 +08:00
parent 0c953105c8
commit 0ac468d85c
1 changed files with 16 additions and 8 deletions

View File

@ -289,16 +289,24 @@ class Auth extends \fast\Auth
*/
public function getChildrenAdminIds($withself = false)
{
$groupIds = $this->getChildrenGroupIds(false);
$childrenAdminIds = [];
$authGroupList = model('AuthGroupAccess')
->field('uid,group_id')
->where('group_id', 'in', $groupIds)
->select();
foreach ($authGroupList as $k => $v)
if (!$this->isSuperAdmin())
{
$childrenAdminIds[] = $v['uid'];
$groupIds = $this->getChildrenGroupIds(false);
$authGroupList = model('AuthGroupAccess')
->field('uid,group_id')
->where('group_id', 'in', $groupIds)
->select();
foreach ($authGroupList as $k => $v)
{
$childrenAdminIds[] = $v['uid'];
}
}
else
{
//超级管理员拥有所有人的权限
$childrenAdminIds = Admin::column('id');
}
if ($withself)
{