diff --git a/app/Services/DashboardCeoService.php b/app/Services/DashboardCeoService.php index 1dccd321..540dae20 100644 --- a/app/Services/DashboardCeoService.php +++ b/app/Services/DashboardCeoService.php @@ -467,12 +467,15 @@ private function getShipmentSummary(int $tenantId, string $today): array $monthEnd = $thisMonth->copy()->endOfMonth()->format('Y-m-d'); // 예정 출고 + // NOTE: shipments 테이블에 shipping_cost 컬럼이 아직 없음 (2026-03-19) + // 금액 집계는 컬럼 추가 + 입력 UI 반영 후 활성화 예정 + // TODO: shipping_cost 컬럼 추가 시 → selectRaw에 SUM(shipping_cost) 복원 $expected = DB::table('shipments') ->where('tenant_id', $tenantId) ->whereBetween('scheduled_date', [$monthStart, $monthEnd]) ->whereIn('status', ['scheduled', 'ready']) ->whereNull('deleted_at') - ->selectRaw('COUNT(*) as count, COALESCE(SUM(shipping_cost), 0) as amount') + ->selectRaw('COUNT(*) as count') ->first(); // 실제 출고 @@ -481,13 +484,13 @@ private function getShipmentSummary(int $tenantId, string $today): array ->whereBetween('scheduled_date', [$monthStart, $monthEnd]) ->whereIn('status', ['shipping', 'completed']) ->whereNull('deleted_at') - ->selectRaw('COUNT(*) as count, COALESCE(SUM(shipping_cost), 0) as amount') + ->selectRaw('COUNT(*) as count') ->first(); return [ - 'expected_amount' => (int) ($expected->amount ?? 0), + 'expected_amount' => 0, // shipping_cost 컬럼 추가 전까지 0 고정 'expected_count' => (int) ($expected->count ?? 0), - 'actual_amount' => (int) ($actual->amount ?? 0), + 'actual_amount' => 0, // shipping_cost 컬럼 추가 전까지 0 고정 'actual_count' => (int) ($actual->count ?? 0), ]; }