优化管理员日志管理只显示当前组以及以下的数据
This commit is contained in:
@@ -297,6 +297,26 @@ class Auth extends \ba\Auth
|
||||
return array_unique($children);
|
||||
}
|
||||
|
||||
/**
|
||||
* 本人 + 树形下级角色组内的管理员 ID(与管理员管理列表数据范围一致)
|
||||
*/
|
||||
public function getSelfAndSubordinateAdminIds(): array
|
||||
{
|
||||
if ($this->isSuperAdmin()) {
|
||||
return [];
|
||||
}
|
||||
$descendantGroupIds = $this->getAdminChildGroups();
|
||||
$adminIds = [];
|
||||
if ($descendantGroupIds !== []) {
|
||||
$adminIds = Db::name('admin_group_access')
|
||||
->where('group_id', 'in', $descendantGroupIds)
|
||||
->column('uid');
|
||||
}
|
||||
$adminIds[] = $this->id;
|
||||
|
||||
return array_values(array_unique($adminIds));
|
||||
}
|
||||
|
||||
public function getGroupChildGroups(int $groupId, array &$children): void
|
||||
{
|
||||
$childrenTemp = AdminGroup::where('pid', $groupId)
|
||||
|
||||
Reference in New Issue
Block a user