From ef6b1330fcb236ece0e860ed882d0dda86e09b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Wed, 21 Jan 2026 10:39:54 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20EntertainmentService=20order=5Fdate=20?= =?UTF-8?q?=E2=86=92=20received=5Fat=20=EC=BB=AC=EB=9F=BC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/EntertainmentService.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Services/EntertainmentService.php b/app/Services/EntertainmentService.php index 893154e..651816c 100644 --- a/app/Services/EntertainmentService.php +++ b/app/Services/EntertainmentService.php @@ -121,13 +121,15 @@ public function getSummary( */ private function getAnnualSales(int $tenantId, string $startDate, string $endDate): float { - // TODO: 실제 매출 테이블에서 조회 - // 현재는 임시로 고정값 반환 (orders 테이블 또는 invoices 테이블에서 합계) - return DB::table('orders') + // orders 테이블에서 확정된 수주 합계 조회 + $amount = DB::table('orders') ->where('tenant_id', $tenantId) - ->whereBetween('order_date', [$startDate, $endDate]) + ->where('status_code', 'confirmed') + ->whereBetween('received_at', [$startDate, $endDate]) ->whereNull('deleted_at') - ->sum('total_amount') ?: 30530000000; + ->sum('total_amount'); + + return $amount ?: 30530000000; // 임시 기본값 (305억) } /**