Changed logic for laser idle report #1175
@@ -89,12 +89,18 @@ class SendLaserIdleHourReport extends Command
|
|||||||
|
|
||||||
$motorCount = $machineRecords
|
$motorCount = $machineRecords
|
||||||
->where('motor_machine_name', $machineName)
|
->where('motor_machine_name', $machineName)
|
||||||
|
->filter(function ($record) {
|
||||||
|
return (float) ($record->motor_marked_physical_count ?? 0) > 0;
|
||||||
|
})
|
||||||
->sum(function ($record) {
|
->sum(function ($record) {
|
||||||
return (float) ($record->motor_marked_physical_count ?? 0);
|
return (float) ($record->motor_marked_physical_count ?? 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
$pumpCount = $machineRecords
|
$pumpCount = $machineRecords
|
||||||
->where('pump_machine_name', $machineName)
|
->where('pump_machine_name', $machineName)
|
||||||
|
->filter(function ($record) {
|
||||||
|
return (float) ($record->pump_marked_physical_count ?? 0) > 0;
|
||||||
|
})
|
||||||
->sum(function ($record) {
|
->sum(function ($record) {
|
||||||
return (float) ($record->pump_marked_physical_count ?? 0);
|
return (float) ($record->pump_marked_physical_count ?? 0);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user