This commit is contained in:
Your Name
2026-05-05 14:34:39 +08:00
parent c03e7051d7
commit 40eec808ef
7 changed files with 291 additions and 352 deletions
@@ -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);
}
/**