Explorar el Código

feat(express): 添加物流查询中的发货类型参数支持

- 在ExpressService::express方法中新增delivery_type参数,默认值为1
- 添加虚拟发货类型判断,当delivery_type为3时不返回物流信息
- 修改StoreOrder控制器中调用express方法传入订单发货类型参数
- 实现不同类型发货的差异化物流信息处理逻辑
shichen hace 4 meses
padre
commit
e7e2df62eb

+ 1 - 1
app/controller/api/store/order/StoreOrder.php

@@ -1179,7 +1179,7 @@ class StoreOrder extends BaseController
1179 1179
             return app('json')->fail('订单未发货');
1180 1180
         $merchantRepository = app()->make(MerchantRepository::class);
1181 1181
         $order['mer_service_phone'] = $merchantRepository->get($order['mer_id'])['mer_phone'] ?? '';
1182
-        $express = ExpressService::express($order->delivery_id);
1182
+        $express = ExpressService::express($order->delivery_id,$order->delivery_type);
1183 1183
         $order->append(['orderProduct']);
1184 1184
         return app('json')->success(compact('express', 'order'));
1185 1185
     }

+ 5 - 1
crmeb/services/ExpressService.php

@@ -25,8 +25,12 @@ class ExpressService
25 25
         return json_decode($res, true) ?: null;
26 26
     }
27 27
 
28
-    public static function express($delivery_id)
28
+    public static function express($delivery_id, $delivery_type = 1)
29 29
     {
30
+        // 虚拟发货不返回物流信息
31
+        if ($delivery_type == 3) {
32
+            return [];
33
+        }
30 34
         if (Cache::has('express_' . $delivery_id)) {
31 35
             $result = Cache::get('express_' . $delivery_id);
32 36
         } else {