...
|
...
|
@@ -451,6 +451,8 @@ class CartModel |
|
|
// 订单数据
|
|
|
if (isset($payReturn['shopping_cart_data']) && !empty($payReturn['shopping_cart_data'])) {
|
|
|
$result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list'];
|
|
|
$price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount'];
|
|
|
$result['price'] = Helpers::transPrice($price);
|
|
|
|
|
|
/*$sumPrice = isset($orderCompute['order_amount']) ? $orderCompute['order_amount'] : $payReturn['shopping_cart_data']['order_amount'];
|
|
|
|
...
|
...
|
@@ -569,17 +571,21 @@ class CartModel |
|
|
$coupons = CartData::getCouponList($uid);
|
|
|
|
|
|
do {
|
|
|
if ($onlyTotal) {
|
|
|
$result['count'] = count($coupons['data']['couponList']);
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
if (isset($coupons['data']['couponList'])) {
|
|
|
foreach ($coupons['data']['couponList'] as &$val) {
|
|
|
$val['notAvailable'] = $val['isValidity'] === 'N';
|
|
|
foreach ($coupons['data']['couponList'] as $val) {
|
|
|
$notAvailableRes = self::searchCoupon($uid, $val['couponCode']);
|
|
|
// 处理可用的优惠券
|
|
|
if ($val['isValidity'] === 'N' || (isset($notAvailableRes['code']) && $notAvailableRes['code'] !== 200)) {
|
|
|
// $val['notAvailable'] = true;
|
|
|
continue;
|
|
|
}
|
|
|
$result[] = $val;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$result = $coupons['data']['couponList'];
|
|
|
if ($onlyTotal) {
|
|
|
$count = count($result);
|
|
|
$result = array('count' => $count);
|
|
|
}
|
|
|
}while(0);
|
|
|
|
...
|
...
|
|