소스 검색

测试用例问题修复

LD 5 년 전
부모
커밋
53c744e5a6
4개의 변경된 파일5개의 추가작업 그리고 13개의 파일을 삭제
  1. 2 11
      app/Http/Controllers/TestController.php
  2. 3 2
      app/Services/StationTaskBatchService.php
  3. 0 0
      tests/CreatesApplication.php
  4. 0 0
      tests/TestCase.php

+ 2 - 11
app/Http/Controllers/TestController.php

@@ -142,17 +142,8 @@ class TestController extends Controller
     }
 
     public function test4(){
-        $order = Order::query()->whereHas("packages",function ($query){
-            /** @var Builder $query */
-            $query->whereHas("commodities",function ($query){
-                /** @var Builder $query */
-                $query->whereHas("commodity",function ($query){
-                    /** @var Builder $query */
-                    $query->whereNotNull("name");
-                });
-            });
-        })->first();
-        OrderCreateInstantBill::dispatch($order);
+        $arr=[['id'=>3],['id'=>33],];
+        dd(data_get($arr,'*.id'));
     }
     public function t($a)
     {

+ 3 - 2
app/Services/StationTaskBatchService.php

@@ -38,6 +38,7 @@ class StationTaskBatchService
         $station=$this->stationService->getDefaultStation('料箱出货口');
         $id_stationMissionBatchType=$this->stationTaskBatchTypeService->firstByWhere('name','U型线分捡');
 
+        $batches_handled=[];
         foreach ($batches as &$batch){
             if ($batch['status']=='未处理'){
                 $stationMissionBatches_toCreate->push([
@@ -46,10 +47,10 @@ class StationTaskBatchService
                     'station_mission_batch_type_id'=> $id_stationMissionBatchType,
                     'status'=>'待处理'
                 ]);
-                $batch = '已处理';
+                $batches_handled[]=$batch;
             }
         }
-        $this->batchService->updateWhereIn('id',data_get($batches,'*.id'),['status'=>'处理中']);
+        $this->batchService->updateWhereIn('id',data_get($batches_handled,'*.id'),['status'=>'处理中']);
         $this->insert($stationMissionBatches_toCreate->toArray());
         return $stationMissionBatches_toCreate;
     }

+ 0 - 0
tests/webApi/CreatesApplication.php → tests/CreatesApplication.php


+ 0 - 0
tests/webApi/TestCase.php → tests/TestCase.php