...
|
...
|
@@ -368,17 +368,33 @@ class UserModel |
|
|
// 调用接口获取优惠券数据
|
|
|
$coupons = UserData::couponData($uid, $status, $page);
|
|
|
|
|
|
// 处理优惠券数据
|
|
|
if (isset($coupons['data']) && !empty($coupons['data']['total'])) {
|
|
|
$result['coupons'] = $coupons['data']['info'];
|
|
|
// 没有获取到优惠券时
|
|
|
if (!$coupons) {
|
|
|
$result['topURL'] = '/product/new';
|
|
|
$result['noRecord'] = true;
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
foreach ($result['coupons'] as &$val) {
|
|
|
// 处理已使用的优惠券
|
|
|
if ($status == 1) {
|
|
|
$val['used'] = true;
|
|
|
// 处理优惠券数据
|
|
|
if (isset($coupons['data'])) {
|
|
|
// 不能再查到结果了
|
|
|
if ($page == 1 && $coupons['data']['total'] === 0) {
|
|
|
$result['walkwayUrl'] = '/product/new';
|
|
|
$result['noRecord'] = true;
|
|
|
} else {
|
|
|
$couponArr = array();
|
|
|
isset($coupons['data']['info']) && $couponArr = $coupons['data']['info'];
|
|
|
|
|
|
foreach ($couponArr as &$val) {
|
|
|
// 处理已使用的优惠券
|
|
|
if ($status == 1) {
|
|
|
$val['used'] = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
!empty($couponArr) && $result['coupons'] = $couponArr;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return $result;
|
...
|
...
|
|