...
|
...
|
@@ -547,25 +547,20 @@ class CartModel |
|
|
// 调用接口获取优惠券数据
|
|
|
$coupons = CartData::getCouponList($uid);
|
|
|
|
|
|
// 处理优惠券数据
|
|
|
if (isset($coupons['data'])) {
|
|
|
|
|
|
do {
|
|
|
if ($onlyTotal) {
|
|
|
$result['count'] = count($coupons['data']['couponList']);
|
|
|
} else {
|
|
|
$couponArr = array();
|
|
|
isset($coupons['data']['couponList']) && $couponArr = $coupons['data']['couponList'];
|
|
|
|
|
|
foreach ($couponArr as &$val) {
|
|
|
$notAvailableRes = self::searchCoupon($uid, $val['couponCode']);
|
|
|
// 处理可用的优惠券
|
|
|
if (isset($notAvailableRes['code']) && $notAvailableRes['code'] !== 200) {
|
|
|
$val['notAvailable'] = true;
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
if (isset($coupons['data']['couponList'])) {
|
|
|
foreach ($coupons['data']['couponList'] as &$val) {
|
|
|
$val['notAvailable'] = $val['isValidity'] === 'N';
|
|
|
}
|
|
|
!empty($couponArr) && $result = $couponArr;
|
|
|
|
|
|
$result = $coupons['data']['couponList'];
|
|
|
}
|
|
|
}
|
|
|
}while(0);
|
|
|
|
|
|
return $result;
|
|
|
}
|
...
|
...
|
|