solvd issue for cumulative chart
This commit is contained in:
@@ -106,7 +106,8 @@ class CumulativeChart extends ChartWidget
|
|||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
// Define date range with 8 AM shift boundaries
|
// Define date range with 8 AM shift boundaries
|
||||||
switch ($activeFilter) {
|
switch ($activeFilter)
|
||||||
|
{
|
||||||
case 'yesterday':
|
case 'yesterday':
|
||||||
$startDate = now()->subDay()->setTime(8, 0, 0);
|
$startDate = now()->subDay()->setTime(8, 0, 0);
|
||||||
$endDate = now()->setTime(8, 0, 0);
|
$endDate = now()->setTime(8, 0, 0);
|
||||||
@@ -160,12 +161,9 @@ class CumulativeChart extends ChartWidget
|
|||||||
->where('created_at', '<', $endDate)
|
->where('created_at', '<', $endDate)
|
||||||
->whereIn('line_id', $fgLineIds)
|
->whereIn('line_id', $fgLineIds)
|
||||||
->groupBy('line_id')
|
->groupBy('line_id')
|
||||||
->groupByRaw($groupBy)
|
|
||||||
->orderByRaw($groupBy)
|
|
||||||
->pluck('total_quantity', 'line_id')
|
->pluck('total_quantity', 'line_id')
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|
||||||
|
|
||||||
//Non-FG production from production_quantities
|
//Non-FG production from production_quantities
|
||||||
$nonFgProduction = ProductionQuantity::select('line_id', \DB::raw('COUNT(*) as total_quantity'))
|
$nonFgProduction = ProductionQuantity::select('line_id', \DB::raw('COUNT(*) as total_quantity'))
|
||||||
->whereBetween('created_at', [$startDate, $endDate])
|
->whereBetween('created_at', [$startDate, $endDate])
|
||||||
|
|||||||
Reference in New Issue
Block a user