diff --git a/app/Filament/Widgets/CumulativeChart.php b/app/Filament/Widgets/CumulativeChart.php index 85f516a1d..e96e43cc4 100644 --- a/app/Filament/Widgets/CumulativeChart.php +++ b/app/Filament/Widgets/CumulativeChart.php @@ -106,7 +106,8 @@ class CumulativeChart extends ChartWidget // break; // } // Define date range with 8 AM shift boundaries - switch ($activeFilter) { + switch ($activeFilter) + { case 'yesterday': $startDate = now()->subDay()->setTime(8, 0, 0); $endDate = now()->setTime(8, 0, 0); @@ -160,12 +161,9 @@ class CumulativeChart extends ChartWidget ->where('created_at', '<', $endDate) ->whereIn('line_id', $fgLineIds) ->groupBy('line_id') - ->groupByRaw($groupBy) - ->orderByRaw($groupBy) ->pluck('total_quantity', 'line_id') ->toArray(); - //Non-FG production from production_quantities $nonFgProduction = ProductionQuantity::select('line_id', \DB::raw('COUNT(*) as total_quantity')) ->whereBetween('created_at', [$startDate, $endDate])