- 移除了无效的 psType 变量赋值 - 添加了收货地址必填验证并返回错误码 40001 - 统一了错误响应格式为 JSON 格式
@@ -78,7 +78,7 @@ class StoreOrder extends BaseController
if (!($count = count($cartId)) || $count != count($cartRepository->validIntersection($cartId, $uid)))
return app('json')->fail('已失效或已下单');
if (!$addressId) {
- $psType = false;
+ return app('json')->fail('请选择收货地址',null, 40001);
}
$orderInfo = $this->repository->cartIdByOrderInfo($uid, $cartId, $addressId, true, $psType);
$orderInfo['product_type'] = 0;