fix: [payroll] 일괄 생성 시 삭제된 사용자 건너뛰기

- bulkGenerate에서 users 테이블에 존재하지 않는 user_id로 인한 FK 위반 해결
- whereHas('user')로 유효한 사용자만 조회
This commit is contained in:
김보곤
2026-03-12 11:30:50 +09:00
parent 19c524d692
commit 8c301b54e3

View File

@@ -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) {