更新
This commit is contained in:
@@ -672,34 +672,7 @@ class YejiStatsLogic
|
||||
*/
|
||||
private static function buildYejiDataScopeAllowedDeptIdMap(int $adminId, array $adminInfo): ?array
|
||||
{
|
||||
if ($adminId <= 0 || !DataScopeService::isEnabled()) {
|
||||
return null;
|
||||
}
|
||||
$visibleIds = DataScopeService::getVisibleAdminIds($adminId, $adminInfo);
|
||||
if ($visibleIds === null) {
|
||||
return null;
|
||||
}
|
||||
if ($visibleIds === []) {
|
||||
return [];
|
||||
}
|
||||
$set = [];
|
||||
foreach ($visibleIds as $aid) {
|
||||
$deptRows = Db::name('admin_dept')->where('admin_id', (int) $aid)->column('dept_id');
|
||||
foreach ($deptRows as $d) {
|
||||
$d = (int) $d;
|
||||
if ($d <= 0) {
|
||||
continue;
|
||||
}
|
||||
foreach (DeptLogic::getSelfAndDescendantIds($d) as $x) {
|
||||
$x = (int) $x;
|
||||
if ($x > 0) {
|
||||
$set[$x] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $set;
|
||||
return DataScopeService::getAllowedDeptIdSet($adminId, $adminInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user