|
@@ -324,6 +324,12 @@ class CartModel |
|
@@ -324,6 +324,12 @@ class CartModel |
324
|
|
324
|
|
325
|
$pay = CartData::cartPay($uid, $cartType);
|
325
|
$pay = CartData::cartPay($uid, $cartType);
|
326
|
|
326
|
|
|
|
327
|
+ // 商品为空返回
|
|
|
328
|
+ if (!$pay || (isset($pay['data']['goods_list']) && empty($pay['data']['goods_list']))) {
|
|
|
329
|
+ $result['cartUrl'] = Helpers::url('/cart/index/index');
|
|
|
330
|
+ return $result;
|
|
|
331
|
+ }
|
|
|
332
|
+
|
327
|
if ($pay && isset($pay['code']) && $pay['code'] === 200) {
|
333
|
if ($pay && isset($pay['code']) && $pay['code'] === 200) {
|
328
|
$payReturn = $pay['data'];
|
334
|
$payReturn = $pay['data'];
|
329
|
$address = array();
|
335
|
$address = array();
|
|
@@ -335,8 +341,8 @@ class CartModel |
|
@@ -335,8 +341,8 @@ class CartModel |
335
|
}
|
341
|
}
|
336
|
|
342
|
|
337
|
// 根据地址id查询地址信息
|
343
|
// 根据地址id查询地址信息
|
338
|
- if (isset($orderInfo['addressId'])) {
|
|
|
339
|
- $address = UserModel::getAddressDataById($uid, $orderInfo['addressId']);
|
344
|
+ if (isset($orderInfo['address'])) {
|
|
|
345
|
+ $address = $orderInfo['address'];
|
340
|
}
|
346
|
}
|
341
|
|
347
|
|
342
|
// 收货人有关信息
|
348
|
// 收货人有关信息
|
|
@@ -344,8 +350,8 @@ class CartModel |
|
@@ -344,8 +350,8 @@ class CartModel |
344
|
$result['addressId'] = isset($address['address_id']) ? $address['address_id'] : $payReturn['delivery_address']['address_id'];
|
350
|
$result['addressId'] = isset($address['address_id']) ? $address['address_id'] : $payReturn['delivery_address']['address_id'];
|
345
|
$result['name'] = isset($address['consignee']) ? $address['consignee'] : $payReturn['delivery_address']['consignee'];
|
351
|
$result['name'] = isset($address['consignee']) ? $address['consignee'] : $payReturn['delivery_address']['consignee'];
|
346
|
$result['phoneNum'] = isset($address['mobile']) ? $address['mobile'] : $payReturn['delivery_address']['mobile'];
|
352
|
$result['phoneNum'] = isset($address['mobile']) ? $address['mobile'] : $payReturn['delivery_address']['mobile'];
|
347
|
- $result['area'] = isset($address['area']) ? $address['area'] : $payReturn['delivery_address']['area'];
|
|
|
348
|
- $result['address'] = isset($address['address']) ? $address['address'] : $payReturn['delivery_address']['address'];
|
353
|
+// $result['area'] = isset($address['area']) ? $address['area'] : $payReturn['delivery_address']['area'];
|
|
|
354
|
+ $result['addressInfo'] = isset($address['address_info']) ? $address['address_info'] : $payReturn['delivery_address']['area'] . ' ' . $payReturn['delivery_address']['address'];
|
349
|
$isSupport = isset($address['is_support']) ? $address['is_support'] : $payReturn['delivery_address']['is_support'];
|
355
|
$isSupport = isset($address['is_support']) ? $address['is_support'] : $payReturn['delivery_address']['is_support'];
|
350
|
$result['isSupport'] = $isSupport === 'Y';
|
356
|
$result['isSupport'] = $isSupport === 'Y';
|
351
|
}
|
357
|
}
|
|
@@ -477,9 +483,10 @@ class CartModel |
|
@@ -477,9 +483,10 @@ class CartModel |
477
|
isset($orderInfo['msg']) && $result['msg'] = $orderInfo['msg'];
|
483
|
isset($orderInfo['msg']) && $result['msg'] = $orderInfo['msg'];
|
478
|
|
484
|
|
479
|
// 优惠券数据
|
485
|
// 优惠券数据
|
480
|
- $coupons = array();
|
|
|
481
|
- !empty($orderCompute['coupon_amount']) && $coupons['couponName'] = $orderInfo['couponName'];
|
|
|
482
|
- $coupons += self::getCouponList($uid, true);
|
486
|
+ $coupons = array('couponName' => '');
|
|
|
487
|
+ if (!empty($orderCompute['coupon_amount'])) {
|
|
|
488
|
+ $coupons['couponName'] = $orderCompute['coupon_amount'];
|
|
|
489
|
+ }
|
483
|
$result['coupon'] = $coupons;
|
490
|
$result['coupon'] = $coupons;
|
484
|
}
|
491
|
}
|
485
|
|
492
|
|
|
@@ -553,11 +560,10 @@ class CartModel |
|
@@ -553,11 +560,10 @@ class CartModel |
553
|
do {
|
560
|
do {
|
554
|
if (isset($coupons['data']['couponList'])) {
|
561
|
if (isset($coupons['data']['couponList'])) {
|
555
|
foreach ($coupons['data']['couponList'] as $val) {
|
562
|
foreach ($coupons['data']['couponList'] as $val) {
|
556
|
- $notAvailableRes = self::searchCoupon($uid, $val['couponCode']);
|
563
|
+ // $notAvailableRes = self::searchCoupon($uid, $val['couponCode']);
|
557
|
// 处理可用的优惠券
|
564
|
// 处理可用的优惠券
|
558
|
- if ($val['isValidity'] === 'N' || (isset($notAvailableRes['code']) && $notAvailableRes['code'] !== 200)) {
|
565
|
+ if ($val['isValidity'] === 'N') {
|
559
|
$val['notAvailable'] = true;
|
566
|
$val['notAvailable'] = true;
|
560
|
- // continue;
|
|
|
561
|
}
|
567
|
}
|
562
|
$result[] = $val;
|
568
|
$result[] = $val;
|
563
|
}
|
569
|
}
|