fix: [payroll] 일괄 생성 시 삭제된 사용자 건너뛰기
- bulkGenerate에서 users 테이블에 존재하지 않는 user_id로 인한 FK 위반 해결
- whereHas('user')로 유효한 사용자만 조회
This commit is contained in:
@@ -421,6 +421,7 @@ public function bulkGenerate(int $year, int $month): array
|
||||
->with('user:id,name')
|
||||
->where('tenant_id', $tenantId)
|
||||
->where('employee_status', 'active')
|
||||
->whereHas('user')
|
||||
->get();
|
||||
|
||||
DB::transaction(function () use ($employees, $tenantId, $year, $month, $settings, $userId, &$created, &$skipped) {
|
||||
|
||||
Reference in New Issue
Block a user