diff --git a/app/Console/Commands/SendLaserIdleHourReport.php b/app/Console/Commands/SendLaserIdleHourReport.php index b380f043..bbb1b530 100644 --- a/app/Console/Commands/SendLaserIdleHourReport.php +++ b/app/Console/Commands/SendLaserIdleHourReport.php @@ -89,12 +89,18 @@ class SendLaserIdleHourReport extends Command $motorCount = $machineRecords ->where('motor_machine_name', $machineName) + ->filter(function ($record) { + return (float) ($record->motor_marked_physical_count ?? 0) > 0; + }) ->sum(function ($record) { return (float) ($record->motor_marked_physical_count ?? 0); }); $pumpCount = $machineRecords ->where('pump_machine_name', $machineName) + ->filter(function ($record) { + return (float) ($record->pump_marked_physical_count ?? 0) > 0; + }) ->sum(function ($record) { return (float) ($record->pump_marked_physical_count ?? 0); });