1
0
forked from poc/pds

solvd issue for cumulative chart

This commit is contained in:
dhanabalan
2025-06-27 16:46:34 +05:30
parent eb93a8602f
commit cc48e4ae3d

View File

@@ -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])