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, ]; }