fix: [approval] 결재선 인원 목록에서 미배정/퇴사/외주 사용자 제외

- 부서 미배정(department_id NULL) 사용자 목록에서 제외
- 코드브릿지엑스(tenant_id=1) 테넌트에서 영업팀(외주) 제외
This commit is contained in:
김보곤
2026-03-07 21:53:22 +09:00
parent 6c683c7d4e
commit e38ef0f1d5

View File

@@ -84,10 +84,14 @@ public function list(): JsonResponse
->whereRaw('pos_title.`key` COLLATE utf8mb4_unicode_ci = tp.job_title_key COLLATE utf8mb4_unicode_ci');
})
->whereNull('users.deleted_at')
->whereNotNull('tp.department_id')
->where(function ($q) {
$q->whereNull('tp.employee_status')
->orWhere('tp.employee_status', '!=', 'resigned');
})
->when($tenantId == 1, function ($q) {
$q->where('departments.name', '!=', '영업팀');
})
->orderBy('departments.name')
->orderByRaw('COALESCE(pos_rank.sort_order, pos_title.sort_order, 9999) ASC')
->orderBy('users.name')