From be711d8b6e2b5452897aaf34a738ce1ff9fd84c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Mon, 23 Mar 2026 09:04:49 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[=EC=9E=AC=EA=B3=A0]=20=ED=86=B5?= =?UTF-8?q?=EA=B3=84=20API=EC=97=90=20=EC=B5=9C=EB=8C=80=EC=9E=AC=EA=B3=A0?= =?UTF-8?q?=20=EC=B4=88=EA=B3=BC=20=EC=B9=B4=EC=9A=B4=ED=8A=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - stats() 메서드에 over_count (status='over') 쿼리 추가 --- app/Services/StockService.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Services/StockService.php b/app/Services/StockService.php index 5448a137..6a66d594 100644 --- a/app/Services/StockService.php +++ b/app/Services/StockService.php @@ -159,6 +159,14 @@ public function stats(): array }) ->count(); + // 최대재고 초과 (status = 'over') + $overCount = Item::where('items.tenant_id', $tenantId) + ->byItemTypes($stockItemTypes) + ->whereHas('stock', function ($q) { + $q->where('status', 'over'); + }) + ->count(); + // 재고 정보가 없는 Item 수 $noStockCount = Item::where('items.tenant_id', $tenantId) ->byItemTypes($stockItemTypes) @@ -170,6 +178,7 @@ public function stats(): array 'normal_count' => $normalCount, 'low_count' => $lowCount, 'out_count' => $outCount, + 'over_count' => $overCount, 'no_stock_count' => $noStockCount, ]; }