fix code
This commit is contained in:
@@ -32,12 +32,11 @@ class DailyMovingMachineCommand extends Command
|
||||
public function handle(DailyMovingMachinesService $dailyMovingMachines): void
|
||||
{
|
||||
$vehiclesInfo = $dailyMovingMachines->run();
|
||||
$response =$vehiclesInfo->get('vehiclesInfo', collect());
|
||||
$response = collect($vehiclesInfo['vehiclesInfo']);
|
||||
|
||||
$date = now()->toDateString();
|
||||
|
||||
$cmms = $response
|
||||
->pluck('machineCode');
|
||||
$cmms = $response->pluck('machineCode');
|
||||
|
||||
$mission = Mission::query()
|
||||
->whereDate('start_time',$date)
|
||||
@@ -60,12 +59,13 @@ class DailyMovingMachineCommand extends Command
|
||||
}
|
||||
|
||||
foreach ($missionOnly as $code) {
|
||||
$missionRecord = Mission::query()->where('machine_code', $code)
|
||||
$missionId = Mission::query()->where('machine_code', $code)
|
||||
->whereDate('start_time', today())
|
||||
->get();
|
||||
->value('id');
|
||||
|
||||
AssignmentFails::query()->create([
|
||||
'machine_code' => $code,
|
||||
'mission_id' => $missionRecord->id,
|
||||
'mission_id' => $missionId,
|
||||
'type' => ActivityMachineType::ADAM_TAHAROK->label(),
|
||||
'request_date' => $date,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user