Explorar o código

重复完成问题

zengjun %!s(int64=3) %!d(string=hai) anos
pai
achega
acf0833fa3
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      app/Services/WorkOrderInterceptService.php

+ 3 - 1
app/Services/WorkOrderInterceptService.php

@@ -200,7 +200,9 @@ class WorkOrderInterceptService extends WorkOrderService
         /** @var WorkOrderDetail $detail */
         $issueType = $this->issueTypeService->firstOrCreate(['name' => '拦截']);
         if ($workOrder->order_issue_type_id != $issueType->id) return;
-        $detail = $workOrder->details()->where('order_issue_type_id', $issueType->id)->where('status','!=', 6)->orderByDesc('created_at')->first();
+        $detail = $workOrder->details()->where('order_issue_type_id', $issueType->id)
+            ->whereNotIn('status',[5,6])
+            ->orderByDesc('created_at')->first();
         if (!$detail) return;
         $process_progress = '成功已退回,不赔偿';
         $detail->update([