Просмотр исходного кода

快递同步与查询速度慢的问题

ANG YU 4 лет назад
Родитель
Сommit
aa7e378e35
2 измененных файлов с 4 добавлено и 1 удалено
  1. 3 0
      app/Filters/OrderPackageFilters.php
  2. 1 1
      app/Traits/LogisticSyncTrait.php

+ 3 - 0
app/Filters/OrderPackageFilters.php

@@ -58,6 +58,9 @@ class OrderPackageFilters
         $filters = array_filter($this->request->only($this->filters),function($item){
             return $item !== null;
         });
+        $this->queryBuilder
+            ->whereIn('status', [0,1,2,3,4,5,6,7,8,9,null])
+            ->whereIn('exception_status', [0,1,2,3,4,5,6,7,null]);
         foreach ($filters as $filter => $value) {
             if (method_exists($this, $filter)) {
                 $this->$filter($value, $this->queryBuilder);

+ 1 - 1
app/Traits/LogisticSyncTrait.php

@@ -126,7 +126,7 @@ trait LogisticSyncTrait
                     }
                 }
                 //在途异常修正为派送异常
-                if (($data['exception_status'] ?? '' === '在途异常') && ($data['status'] ?? '' === '派送中')) {
+                if ((($data['exception_status'] ?? '') === '在途异常') && (($data['status'] ?? '') === '派送中')) {
                     $data['exception_status'] = '派送异常';
                 }
                 //内容中有一下信息的,视为签收