fix: [approval] 결재선 인원 목록에서 미배정/퇴사/외주 사용자 제외
- 부서 미배정(department_id NULL) 사용자 목록에서 제외 - 코드브릿지엑스(tenant_id=1) 테넌트에서 영업팀(외주) 제외
This commit is contained in:
@@ -84,10 +84,14 @@ public function list(): JsonResponse
|
|||||||
->whereRaw('pos_title.`key` COLLATE utf8mb4_unicode_ci = tp.job_title_key COLLATE utf8mb4_unicode_ci');
|
->whereRaw('pos_title.`key` COLLATE utf8mb4_unicode_ci = tp.job_title_key COLLATE utf8mb4_unicode_ci');
|
||||||
})
|
})
|
||||||
->whereNull('users.deleted_at')
|
->whereNull('users.deleted_at')
|
||||||
|
->whereNotNull('tp.department_id')
|
||||||
->where(function ($q) {
|
->where(function ($q) {
|
||||||
$q->whereNull('tp.employee_status')
|
$q->whereNull('tp.employee_status')
|
||||||
->orWhere('tp.employee_status', '!=', 'resigned');
|
->orWhere('tp.employee_status', '!=', 'resigned');
|
||||||
})
|
})
|
||||||
|
->when($tenantId == 1, function ($q) {
|
||||||
|
$q->where('departments.name', '!=', '영업팀');
|
||||||
|
})
|
||||||
->orderBy('departments.name')
|
->orderBy('departments.name')
|
||||||
->orderByRaw('COALESCE(pos_rank.sort_order, pos_title.sort_order, 9999) ASC')
|
->orderByRaw('COALESCE(pos_rank.sort_order, pos_title.sort_order, 9999) ASC')
|
||||||
->orderBy('users.name')
|
->orderBy('users.name')
|
||||||
|
|||||||
Reference in New Issue
Block a user