fix: [approval] 결재선 인원 목록에서 퇴사자 제외
- tenant_user_profiles.employee_status = 'resigned' 필터 추가 - search(), list() 두 엔드포인트 모두 적용
This commit is contained in:
@@ -29,6 +29,10 @@ public function search(Request $request): JsonResponse
|
||||
})
|
||||
->leftJoin('departments', 'departments.id', '=', 'tp.department_id')
|
||||
->whereNull('users.deleted_at')
|
||||
->where(function ($q) {
|
||||
$q->whereNull('tp.employee_status')
|
||||
->orWhere('tp.employee_status', '!=', 'resigned');
|
||||
})
|
||||
->when($query, function ($q) use ($query) {
|
||||
$q->where(function ($sub) use ($query) {
|
||||
$sub->where('users.name', 'like', "%{$query}%")
|
||||
@@ -80,6 +84,10 @@ public function list(): JsonResponse
|
||||
->whereRaw('pos_title.`key` COLLATE utf8mb4_unicode_ci = tp.job_title_key COLLATE utf8mb4_unicode_ci');
|
||||
})
|
||||
->whereNull('users.deleted_at')
|
||||
->where(function ($q) {
|
||||
$q->whereNull('tp.employee_status')
|
||||
->orWhere('tp.employee_status', '!=', 'resigned');
|
||||
})
|
||||
->orderBy('departments.name')
|
||||
->orderByRaw('COALESCE(pos_rank.sort_order, pos_title.sort_order, 9999) ASC')
|
||||
->orderBy('users.name')
|
||||
|
||||
Reference in New Issue
Block a user