Explorar el Código

快递信息同步

ANG YU hace 4 años
padre
commit
2a7e5ebb6a
Se han modificado 2 ficheros con 14 adiciones y 1 borrados
  1. 13 0
      app/Http/Controllers/TestController.php
  2. 1 1
      app/Traits/LogisticSyncTrait.php

+ 13 - 0
app/Http/Controllers/TestController.php

@@ -339,4 +339,17 @@ sql;
             '75803656098612'
         ]);
     }
+
+    public function init_在途异常()
+    {
+        $logistic_numbers =  OrderPackage::query()
+            ->select('logistic_number')
+            ->where('exception_status', 5)
+            ->where('created_at', '>=',now()->subDays(20)->toDateTimeString())
+            ->pluck('logistic_number');
+
+        /** @var OrderPackageReceivedSyncService $service */
+        $service = app('OrderPackageReceivedSyncService');
+        $service->syncLogisticRoute(false,$logistic_numbers);
+    }
 }

+ 1 - 1
app/Traits/LogisticSyncTrait.php

@@ -126,7 +126,7 @@ trait LogisticSyncTrait
                         $data['exception_status'] = '在途异常';
                     }
                 }
-                if (Str::contains($last_remark,['代收','快递柜','驿站','自提柜','丰巢','快递小屋','合作点','快递超市'])) {
+                if (Str::contains($last_remark,['代收','快递柜','驿站','自提柜','丰巢','快递小屋','合作点','快递超市','签收'])) {
                     $data['exception_status'] = '';
                     $data['status'] = '已签收';
                 }