|
|
@@ -153,32 +153,17 @@ class StationTaskCommodityService
|
|
|
$stationTaskCommodity['status']=$status;
|
|
|
});
|
|
|
})();
|
|
|
-// ($将所有要标记的商品任务先放在队列里=function()use(&$groupByBatch){
|
|
|
-// $groupByBatch->each(function (&$stationTaskCommodity){
|
|
|
-// $stationTaskCommodity['status']='处理队列';
|
|
|
-// });
|
|
|
-// })();
|
|
|
-// ($如果之前没有处理中则标记第一个为处理目标,并持久化=function()use(&$groupByBatch){
|
|
|
-// $taskBatchId=$groupByBatch[0]['station_task_batch_id'];
|
|
|
-// $processing=$this->getProcessing_byTaskBatch($taskBatchId);
|
|
|
-// if(!$processing){
|
|
|
-// $groupByBatch[0]['status']='处理中';
|
|
|
-// $groupByBatch[0]->update();
|
|
|
-// }else{
|
|
|
-// foreach ($groupByBatch as &$stationTaskCommodity){
|
|
|
-// if($stationTaskCommodity['id']==$processing['id']){
|
|
|
-// $stationTaskCommodity['status']='处理中';
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// })();
|
|
|
});
|
|
|
($持久化处理队列的记录=function()use(&$stationTaskCommodities_grouped){
|
|
|
$toArray = $stationTaskCommodities_grouped->collapse();
|
|
|
- $toArray=$toArray->where('status','处理队列');
|
|
|
- $ids_toUpdate = data_get($toArray, '*.id');
|
|
|
- if(count($ids_toUpdate))
|
|
|
- StationTaskCommodity::query()->where('id',$ids_toUpdate)->update(['status'=>'处理队列']);
|
|
|
+ $toQueue=$toArray->where('status','处理队列');
|
|
|
+ $toProcess=$toArray->where('status','处理中');
|
|
|
+ $ids_toQueue_toUpdate = data_get($toQueue, '*.id');
|
|
|
+ if(count($ids_toQueue_toUpdate))
|
|
|
+ StationTaskCommodity::query()->where('id',$ids_toQueue_toUpdate)->update(['status'=>'处理队列']);
|
|
|
+ $ids_toProcess_toUpdate = data_get($toProcess, '*.id');
|
|
|
+ if(count($ids_toProcess_toUpdate))
|
|
|
+ StationTaskCommodity::query()->where('id',$ids_toProcess_toUpdate)->update(['status'=>'处理中']);
|
|
|
})();
|
|
|
|
|
|
}
|