|
|
@@ -84,14 +84,15 @@ class WorkOrderCancelInterceptController extends Controller
|
|
|
if (count($detail_ids) == 0)
|
|
|
return ['success' => false,'message' => '参数异常'];
|
|
|
|
|
|
- $details = WorkOrderDetail::query()->find($detail_ids);
|
|
|
-
|
|
|
- if (count($details) ==0 || count($details) < count($detail_ids))
|
|
|
- return ['success' => false,'message' => '参数异常'];
|
|
|
+ $details = WorkOrderDetail::query()->where('status', 3)->find($detail_ids);
|
|
|
+ if (count($details) < count($detail_ids))
|
|
|
+ return ['success' => false,'message' => '参数异常,刷新后重试'];
|
|
|
|
|
|
$this->service->logisticBatchHandler($details,$request->all());
|
|
|
- $data = $this->service->getDefaultWith($detail_ids);
|
|
|
- return ['success' => true,$data => $data];
|
|
|
+ $data = $this->service->getDefaultWith($details->map(function($item){
|
|
|
+ return $item->work_order_id;
|
|
|
+ }));
|
|
|
+ return ['success' => true,'data' => $data];
|
|
|
}
|
|
|
|
|
|
public function baoShiReviewApi(Request $request): array
|