Authored by Rock Zhang

修复个人中心优惠券的显示问题

... ... @@ -554,21 +554,11 @@ class UserModel
$coupons = UserData::couponData($uid, $status, $page);
// 没有获取到优惠券时
if (empty($coupons)) {
if (empty($coupons) || empty($coupons['data'])) {
$result['noRecord'] = true;
break;
}
if ($page == 1 && isset($coupons['data']['total']) && $coupons['data']['total'] === 0) {
$result['noRecord'] = true;
break;
}
// 判断是否有优惠券
if (empty($coupons['data']['info'])) {
break;
}
// 处理已使用的优惠券
if ($status == 1) {
foreach ($coupons['data']['info'] as &$value) {
... ... @@ -576,8 +566,10 @@ class UserModel
}
}
if (!empty($coupons['data']['info'])) {
$result['coupons'] = $coupons['data']['info'];
}
}
while (false);
return $result;
... ...