|
@@ -451,6 +451,8 @@ class CartModel |
|
@@ -451,6 +451,8 @@ class CartModel |
451
|
// 订单数据
|
451
|
// 订单数据
|
452
|
if (isset($payReturn['shopping_cart_data']) && !empty($payReturn['shopping_cart_data'])) {
|
452
|
if (isset($payReturn['shopping_cart_data']) && !empty($payReturn['shopping_cart_data'])) {
|
453
|
$result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list'];
|
453
|
$result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list'];
|
|
|
454
|
+ $price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount'];
|
|
|
455
|
+ $result['price'] = Helpers::transPrice($price);
|
454
|
|
456
|
|
455
|
/*$sumPrice = isset($orderCompute['order_amount']) ? $orderCompute['order_amount'] : $payReturn['shopping_cart_data']['order_amount'];
|
457
|
/*$sumPrice = isset($orderCompute['order_amount']) ? $orderCompute['order_amount'] : $payReturn['shopping_cart_data']['order_amount'];
|
456
|
|
458
|
|
|
@@ -569,17 +571,21 @@ class CartModel |
|
@@ -569,17 +571,21 @@ class CartModel |
569
|
$coupons = CartData::getCouponList($uid);
|
571
|
$coupons = CartData::getCouponList($uid);
|
570
|
|
572
|
|
571
|
do {
|
573
|
do {
|
572
|
- if ($onlyTotal) {
|
|
|
573
|
- $result['count'] = count($coupons['data']['couponList']);
|
|
|
574
|
- break;
|
|
|
575
|
- }
|
|
|
576
|
-
|
|
|
577
|
if (isset($coupons['data']['couponList'])) {
|
574
|
if (isset($coupons['data']['couponList'])) {
|
578
|
- foreach ($coupons['data']['couponList'] as &$val) {
|
|
|
579
|
- $val['notAvailable'] = $val['isValidity'] === 'N';
|
575
|
+ foreach ($coupons['data']['couponList'] as $val) {
|
|
|
576
|
+ $notAvailableRes = self::searchCoupon($uid, $val['couponCode']);
|
|
|
577
|
+ // 处理可用的优惠券
|
|
|
578
|
+ if ($val['isValidity'] === 'N' || (isset($notAvailableRes['code']) && $notAvailableRes['code'] !== 200)) {
|
|
|
579
|
+// $val['notAvailable'] = true;
|
|
|
580
|
+ continue;
|
|
|
581
|
+ }
|
|
|
582
|
+ $result[] = $val;
|
|
|
583
|
+ }
|
580
|
}
|
584
|
}
|
581
|
|
585
|
|
582
|
- $result = $coupons['data']['couponList'];
|
586
|
+ if ($onlyTotal) {
|
|
|
587
|
+ $count = count($result);
|
|
|
588
|
+ $result = array('count' => $count);
|
583
|
}
|
589
|
}
|
584
|
}while(0);
|
590
|
}while(0);
|
585
|
|
591
|
|