Showing
1 changed file
with
5 additions
and
13 deletions
@@ -554,20 +554,10 @@ class UserModel | @@ -554,20 +554,10 @@ 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 | - | ||
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 | 561 | ||
572 | // 处理已使用的优惠券 | 562 | // 处理已使用的优惠券 |
573 | if ($status == 1) { | 563 | if ($status == 1) { |
@@ -575,8 +565,10 @@ class UserModel | @@ -575,8 +565,10 @@ class UserModel | ||
575 | $value['used'] = true; | 565 | $value['used'] = true; |
576 | } | 566 | } |
577 | } | 567 | } |
578 | - | ||
579 | - $result['coupons'] = $coupons['data']['info']; | 568 | + |
569 | + if (!empty($coupons['data']['info'])) { | ||
570 | + $result['coupons'] = $coupons['data']['info']; | ||
571 | + } | ||
580 | } | 572 | } |
581 | while (false); | 573 | while (false); |
582 | 574 |
-
Please register or login to post a comment