stationService=null; $this->stationTypeService=null; $this->stationTaskBatchTypeService=null; $this->batchService=null; $this->stationTaskService=null; $this->stationTaskMaterialBoxService=null; } function get(array $whereParams){ ksort($whereParams); return Cache::remember('stationTaskChild_'.md5(json_encode($whereParams)), config('cache.expirations.oftenChange'), function ()use($whereParams) { $query = StationTaskCommodity::query(); foreach ($whereParams as $column => $value){ if (is_array($value))$query->whereIn($column,$value); else $query->where($column,$value); } return $query->get(); }); } function createByBatches(array $batches): Collection { $stationTaskCommodity_toCreate=new Collection(); $batches_handled=collect(); foreach ($batches as $batch){ $stationType=$this->stationTypeService->getByBatch($batch); $station=$this->stationService->getStation_byType($stationType['name']); // $materialBox=$this->stationTaskMaterialBoxService->get(['code'=>]); // $stationTaskCommodity_toCreate->push([ // 'station_id'=>$station['id'], // 'station_id'=>$station['id'], // 'status'=>'待处理' // ]); $batches_handled->push($batch); } $this->batchService->updateWhereIn('id',data_get($batches_handled,'*.id'),['status'=>'处理中']); } }