Authored by Rock Zhang

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

... ... @@ -532,31 +532,23 @@ class UserModel
do {
// 调用接口获取优惠券数据
$coupons = UserData::couponData($uid, $status, $page);
// 没有获取到优惠券时
if (empty($coupons)) {
$result['noRecord'] = true;
break;
}
if ($page == 1 && isset($coupons['data']['total']) && $coupons['data']['total'] === 0) {
// 没有获取到优惠券时
if (empty($coupons) || empty($coupons['data'])) {
$result['noRecord'] = true;
break;
}
// 判断是否有优惠券
if (empty($coupons['data']['info'])) {
break;
}
// 处理已使用的优惠券
if ($status == 1) {
foreach ($coupons['data']['info'] as &$value) {
$value['used'] = true;
}
}
$result['coupons'] = $coupons['data']['info'];
if (!empty($coupons['data']['info'])) {
$result['coupons'] = $coupons['data']['info'];
}
}
while (false);
... ...