LD 5 лет назад
Родитель
Сommit
18b97c2907
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      app/Services/StationTaskBatchService.php
  2. 2 2
      app/Services/StationTaskService.php

+ 2 - 2
app/Services/StationTaskBatchService.php

@@ -88,8 +88,8 @@ class StationTaskBatchService
 
     function getAndAttachIds($stationTaskBatches): Collection
     {
-        $md5=is_array($stationTaskBatches)
-            ?$md5=md5(json_encode($stationTaskBatches)):null;
+        $md5=md5(is_array($stationTaskBatches)
+            ?$md5=json_encode($stationTaskBatches):$stationTaskBatches->toJson());
 
         return Cache::remember(
             'StationTaskBatch_'.$md5??md5(json_encode($stationTaskBatches->toArray()))

+ 2 - 2
app/Services/StationTaskService.php

@@ -53,9 +53,9 @@ class StationTaskService
                 $taskChild_existed=$this->stationTaskChildService->get($paramToInsert)->first();
                 if(!$taskChild_existed){
                     $taskChildren_toInsert->push($paramToInsert);
+                    $subTask['station_task_id']=$tasks[$i]['id'];
+                    $subTask->save();
                 }
-                $subTask['station_task_id']=$tasks[$i]['id'];
-                $subTask->save();
             }
         }
         $this->stationTaskChildService->insert($taskChildren_toInsert->toArray());