Showing
1 changed file
with
3 additions
and
11 deletions
@@ -554,21 +554,11 @@ class UserModel | @@ -554,21 +554,11 @@ class UserModel | ||
554 | $coupons = UserData::couponData($uid, $status, $page); | 554 | $coupons = UserData::couponData($uid, $status, $page); |
555 | 555 | ||
556 | // 没有获取到优惠券时 | 556 | // 没有获取到优惠券时 |
557 | - if (empty($coupons)) { | 557 | + if (empty($coupons) || empty($coupons['data'])) { |
558 | $result['noRecord'] = true; | 558 | $result['noRecord'] = true; |
559 | break; | 559 | break; |
560 | } | 560 | } |
561 | 561 | ||
562 | - if ($page == 1 && isset($coupons['data']['total']) && $coupons['data']['total'] === 0) { | ||
563 | - $result['noRecord'] = true; | ||
564 | - break; | ||
565 | - } | ||
566 | - | ||
567 | - // 判断是否有优惠券 | ||
568 | - if (empty($coupons['data']['info'])) { | ||
569 | - break; | ||
570 | - } | ||
571 | - | ||
572 | // 处理已使用的优惠券 | 562 | // 处理已使用的优惠券 |
573 | if ($status == 1) { | 563 | if ($status == 1) { |
574 | foreach ($coupons['data']['info'] as &$value) { | 564 | foreach ($coupons['data']['info'] as &$value) { |
@@ -576,8 +566,10 @@ class UserModel | @@ -576,8 +566,10 @@ class UserModel | ||
576 | } | 566 | } |
577 | } | 567 | } |
578 | 568 | ||
569 | + if (!empty($coupons['data']['info'])) { | ||
579 | $result['coupons'] = $coupons['data']['info']; | 570 | $result['coupons'] = $coupons['data']['info']; |
580 | } | 571 | } |
572 | + } | ||
581 | while (false); | 573 | while (false); |
582 | 574 | ||
583 | return $result; | 575 | return $result; |
-
Please register or login to post a comment