diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index e8ce2af78..0f4ce66aa 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -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 = []; diff --git a/Application/Admin/View/CompanyStatementPool/editPuPool.html b/Application/Admin/View/CompanyStatementPool/editPuPool.html index 7b849a44d..7f0352ae2 100644 --- a/Application/Admin/View/CompanyStatementPool/editPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/editPuPool.html @@ -110,6 +110,7 @@