Skip to content

Commit

Permalink
fix: 部门编辑报错
Browse files Browse the repository at this point in the history
  • Loading branch information
kanyxmo committed Jun 19, 2023
1 parent 831437f commit 38293ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/System/Service/SystemDeptService.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ public function update(int $id, array $data): bool
*/
protected function handleData($data): array
{
if (isset($data['id']) && $data['id'] == $data['parent_id']) {
$pid = $data['parent_id'] ?? 0;

if (isset($data['id']) && $data['id'] == $pid) {
throw new NormalStatusException(t('system.parent_dept_error'), 500);
}

$pid = $data['parent_id'] ?? 0;

if ($pid === 0) {
$data['level'] = $data['parent_id'] = '0';
} else {
Expand Down

0 comments on commit 38293ff

Please sign in to comment.