From 8c301b54e3d93526f6a7f2be79c4e1371a1e80de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 12 Mar 2026 11:30:50 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[payroll]=20=EC=9D=BC=EA=B4=84=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EC=8B=9C=20=EC=82=AD=EC=A0=9C=EB=90=9C=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=20=EA=B1=B4=EB=84=88=EB=9B=B0?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bulkGenerate에서 users 테이블에 존재하지 않는 user_id로 인한 FK 위반 해결 - whereHas('user')로 유효한 사용자만 조회 --- app/Services/PayrollService.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Services/PayrollService.php b/app/Services/PayrollService.php index 798d363..2413047 100644 --- a/app/Services/PayrollService.php +++ b/app/Services/PayrollService.php @@ -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) {