Преглед изворни кода

fix(order): 解决订单创建时收货地址验证问题

- 移除了无效的 psType 变量赋值
- 添加了收货地址必填验证并返回错误码 40001
- 统一了错误响应格式为 JSON 格式
shichen пре 2 месеци
родитељ
комит
f8a97d5f16
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      app/controller/api/store/order/StoreOrder.php

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

@@ -78,7 +78,7 @@ class StoreOrder extends BaseController
78 78
         if (!($count = count($cartId)) || $count != count($cartRepository->validIntersection($cartId, $uid)))
79 79
             return app('json')->fail('已失效或已下单');
80 80
         if (!$addressId) {
81
-            $psType = false;
81
+            return app('json')->fail('请选择收货地址',null, 40001);
82 82
         }
83 83
         $orderInfo = $this->repository->cartIdByOrderInfo($uid, $cartId, $addressId, true, $psType);
84 84
         $orderInfo['product_type'] = 0;