|
|
|
@ -2893,8 +2893,11 @@ function getAdminDepartmentList(array $ids)
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
$rows = M('auth_group_access', 'sys_')->field(['uid', 'group_id'])->where(['uid' => ['in', $ids]])->select();
|
|
|
|
|
$groups = M('auth_group', 'sys_')->field(['id', 'department_id', 'department_name'])->where(['id' => ['in', array_column($rows, 'group_id')]])->select();
|
|
|
|
|
$groups = index_by_column('id', $groups);
|
|
|
|
|
$groups = [];
|
|
|
|
|
if (count($groups) > 0) {
|
|
|
|
|
$groups = M('auth_group', 'sys_')->field(['id', 'department_id', 'department_name'])->where(['id' => ['in', array_column($rows, 'group_id')]])->select();
|
|
|
|
|
$groups = index_by_column('id', $groups);
|
|
|
|
|
}
|
|
|
|
|
$items = [];
|
|
|
|
|
foreach ($rows as $row) {
|
|
|
|
|
$group = $groups[$row['group_id']] ?? null;
|
|
|
|
@ -2907,7 +2910,11 @@ function getGroupDepartmentList(array $ids = null)
|
|
|
|
|
{
|
|
|
|
|
$map = [];
|
|
|
|
|
if ($ids) {
|
|
|
|
|
$map['id'] = ['in', $ids];
|
|
|
|
|
if (count($ids) > 0) {
|
|
|
|
|
$map['id'] = ['in', $ids];
|
|
|
|
|
} else {
|
|
|
|
|
$map['id'] = ['in', [-1]];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$groups = M('auth_group', 'sys_')->field(['id', 'department_id', 'department_name'])->where($map)->select();
|
|
|
|
|
$items = [];
|
|
|
|
|