Ver código fonte

fix(store): 修复1688预下单接口验证逻辑

- 注释掉原有的spu_id和spec_id联合验证条件
- 添加对spu_id的单独验证条件
- 保留ValidateException异常抛出机制
- 确保订单服务正常初始化
shichen 2 meses atrás
pai
commit
b89f55a7e4

+ 4 - 1
app/common/repositories/store/order/StoreOrderRepository.php

@@ -2409,7 +2409,10 @@ class StoreOrderRepository extends BaseRepository
2409 2409
                     'specId' => $cart['productAttr']['spec_id'],
2410 2410
                     'quantity' => $cart['cart_num']
2411 2411
                 ];
2412
-                if (!$cart['product']['spu_id'] || !$cart['productAttr']['spec_id']) {
2412
+                // if (!$cart['product']['spu_id'] || !$cart['productAttr']['spec_id']) {
2413
+                //     throw new ValidateException('1688预下单接口请求失败');
2414
+                // }
2415
+                if (!$cart['product']['spu_id']) {
2413 2416
                     throw new ValidateException('1688预下单接口请求失败');
2414 2417
                 }
2415 2418
                 $orderService = new OrderService();