...
|
...
|
@@ -324,6 +324,12 @@ class CartModel |
|
|
|
|
|
$pay = CartData::cartPay($uid, $cartType);
|
|
|
|
|
|
// 商品为空返回
|
|
|
if (!$pay || (isset($pay['data']['goods_list']) && empty($pay['data']['goods_list']))) {
|
|
|
$result['cartUrl'] = Helpers::url('/cart/index/index');
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
if ($pay && isset($pay['code']) && $pay['code'] === 200) {
|
|
|
$payReturn = $pay['data'];
|
|
|
$address = array();
|
...
|
...
|
@@ -335,8 +341,8 @@ class CartModel |
|
|
}
|
|
|
|
|
|
// 根据地址id查询地址信息
|
|
|
if (isset($orderInfo['addressId'])) {
|
|
|
$address = UserModel::getAddressDataById($uid, $orderInfo['addressId']);
|
|
|
if (isset($orderInfo['address'])) {
|
|
|
$address = $orderInfo['address'];
|
|
|
}
|
|
|
|
|
|
// 收货人有关信息
|
...
|
...
|
@@ -344,8 +350,8 @@ class CartModel |
|
|
$result['addressId'] = isset($address['address_id']) ? $address['address_id'] : $payReturn['delivery_address']['address_id'];
|
|
|
$result['name'] = isset($address['consignee']) ? $address['consignee'] : $payReturn['delivery_address']['consignee'];
|
|
|
$result['phoneNum'] = isset($address['mobile']) ? $address['mobile'] : $payReturn['delivery_address']['mobile'];
|
|
|
$result['area'] = isset($address['area']) ? $address['area'] : $payReturn['delivery_address']['area'];
|
|
|
$result['address'] = isset($address['address']) ? $address['address'] : $payReturn['delivery_address']['address'];
|
|
|
// $result['area'] = isset($address['area']) ? $address['area'] : $payReturn['delivery_address']['area'];
|
|
|
$result['addressInfo'] = isset($address['address_info']) ? $address['address_info'] : $payReturn['delivery_address']['area'] . ' ' . $payReturn['delivery_address']['address'];
|
|
|
$isSupport = isset($address['is_support']) ? $address['is_support'] : $payReturn['delivery_address']['is_support'];
|
|
|
$result['isSupport'] = $isSupport === 'Y';
|
|
|
}
|
...
|
...
|
@@ -477,9 +483,10 @@ class CartModel |
|
|
isset($orderInfo['msg']) && $result['msg'] = $orderInfo['msg'];
|
|
|
|
|
|
// 优惠券数据
|
|
|
$coupons = array();
|
|
|
!empty($orderCompute['coupon_amount']) && $coupons['couponName'] = $orderInfo['couponName'];
|
|
|
$coupons += self::getCouponList($uid, true);
|
|
|
$coupons = array('couponName' => '');
|
|
|
if (!empty($orderCompute['coupon_amount'])) {
|
|
|
$coupons['couponName'] = $orderCompute['coupon_amount'];
|
|
|
}
|
|
|
$result['coupon'] = $coupons;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -553,11 +560,10 @@ class CartModel |
|
|
do {
|
|
|
if (isset($coupons['data']['couponList'])) {
|
|
|
foreach ($coupons['data']['couponList'] as $val) {
|
|
|
$notAvailableRes = self::searchCoupon($uid, $val['couponCode']);
|
|
|
// $notAvailableRes = self::searchCoupon($uid, $val['couponCode']);
|
|
|
// 处理可用的优惠券
|
|
|
if ($val['isValidity'] === 'N' || (isset($notAvailableRes['code']) && $notAvailableRes['code'] !== 200)) {
|
|
|
if ($val['isValidity'] === 'N') {
|
|
|
$val['notAvailable'] = true;
|
|
|
// continue;
|
|
|
}
|
|
|
$result[] = $val;
|
|
|
}
|
...
|
...
|
|