diff --git a/app/Services/ProductionOrderService.php b/app/Services/ProductionOrderService.php index a4889de..638ca00 100644 --- a/app/Services/ProductionOrderService.php +++ b/app/Services/ProductionOrderService.php @@ -30,7 +30,9 @@ public function index(array $params): LengthAwarePaginator ->whereIn('status_code', self::PRODUCTION_STATUSES) ->with(['client', 'workOrders.process', 'workOrders.assignees.user']) ->withCount([ - 'workOrders' => fn ($q) => $q->whereNotNull('process_id'), + 'workOrders' => fn ($q) => $q->whereNotNull('process_id') + ->where(fn ($q2) => $q2->whereNull('options->is_auxiliary') + ->orWhere('options->is_auxiliary', false)), 'nodes', ]);