Authored by Rock Zhang

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

... ... @@ -554,20 +554,10 @@ 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) {
... ... @@ -575,8 +565,10 @@ class UserModel
$value['used'] = true;
}
}
$result['coupons'] = $coupons['data']['info'];
if (!empty($coupons['data']['info'])) {
$result['coupons'] = $coupons['data']['info'];
}
}
while (false);
... ...