浏览代码

station_task_commodities,station_task_material_box_id字段可为空。$stationTaskBatch的ID取错

LD 4 年之前
父节点
当前提交
1780eb8f34
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/Services/StationTaskCommodityService.php

+ 1 - 1
app/Services/StationTaskCommodityService.php

@@ -108,7 +108,7 @@ class StationTaskCommodityService
             $stationType=$this->stationTypeService->getForCommodity();
             $stationType=$this->stationTypeService->getForCommodity();
             $station=$this->stationService->getStation_byType($stationType['name']);
             $station=$this->stationService->getStation_byType($stationType['name']);
             $materialBox=$this->materialBoxService->firstOrCreate(['code' => $orderCommodity['location']]);
             $materialBox=$this->materialBoxService->firstOrCreate(['code' => $orderCommodity['location']]);
-            $stationTaskMaterialBoxId=StationTaskMaterialBox::query()->where('station_task_batch_id',$batch['id'])->where('material_box_id',$materialBox['id'])->get('id')->first()['id']??null;
+            $stationTaskMaterialBoxId=StationTaskMaterialBox::query()->where('station_task_batch_id',$stationTaskBatch['id'])->where('material_box_id',$materialBox['id'])->get('id')->first()['id']??null;
             $stationTaskCommodities_toCreate->push(
             $stationTaskCommodities_toCreate->push(
                 new StationTaskCommodity([
                 new StationTaskCommodity([
                     'station_id'=>$station['id'],
                     'station_id'=>$station['id'],