From 3bf96c8ddb5a249011224afe4b168fa96f6caeae Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 6 Oct 2026 09:56:56 +0530 Subject: [PATCH] changed logic for log info in laser --- app/Console/Commands/SendLaserIdleHourReport.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/SendLaserIdleHourReport.php b/app/Console/Commands/SendLaserIdleHourReport.php index d662e115..3ebb28e2 100644 --- a/app/Console/Commands/SendLaserIdleHourReport.php +++ b/app/Console/Commands/SendLaserIdleHourReport.php @@ -98,8 +98,10 @@ class SendLaserIdleHourReport extends Command // return (float) ($record->motor_marked_physical_count ?? 0); // }); - $pumpCount = $machineRecords - ->where('pump_machine_name', $machineName) + $pumpRecords = $machineRecords + ->where('pump_machine_name', $machineName); + $pumpCount = $pumpRecords + // ->where('pump_machine_name', $machineName) // ->where('pump_marked_status', 'Marked') ->sum(fn ($record) => (float) ($record->pump_marked_physical_count ?? 0)); // ->filter(function ($record) { @@ -114,9 +116,9 @@ class SendLaserIdleHourReport extends Command 'plant_id' => $plant->id, 'plant' => $plant->name, 'machine' => $machineName, - 'pump_rows' => $machineRecords->count(), + 'pump_rows' => $pumpRecords->count(), 'pump_sum' => $pumpCount, - 'pump_values' => $machineRecords + 'pump_values' => $pumpRecords ->pluck('pump_marked_physical_count') ->countBy() ->toArray(),