Showing
1 changed file
with
12 additions
and
17 deletions
@@ -95,26 +95,21 @@ exports.getCouponStatus = (params) => { | @@ -95,26 +95,21 @@ exports.getCouponStatus = (params) => { | ||
95 | break; | 95 | break; |
96 | } | 96 | } |
97 | 97 | ||
98 | - coupon.data.forEach(function(val) { | ||
99 | - if (val.template_name === 'getCoupon' && val.data.length) { | ||
100 | - // 优惠券楼层 | ||
101 | - val.data.forEach(function(item) { | ||
102 | - const status = Number(item.status); | 98 | + coupon.data.forEach(function(item) { |
99 | + const status = Number(item.status); | ||
103 | 100 | ||
104 | - if ([2, 3].indexOf(status) > -1) { | ||
105 | - const cou = { | ||
106 | - id: crypto.encryption('yoho9646abcdefgh', item.couponID) // 加密优惠券号 | ||
107 | - }; | 101 | + if ([2, 3].indexOf(status) > -1) { |
102 | + const cou = { | ||
103 | + id: crypto.encryption('yoho9646abcdefgh', item.couponId) // 加密优惠券号 | ||
104 | + }; | ||
108 | 105 | ||
109 | - if (status === 2) { | ||
110 | - cou.empty = true; // 优惠券已抢光 | ||
111 | - } else if (status === 3) { | ||
112 | - cou.got = true; // 优惠券已领取 | ||
113 | - } | 106 | + if (status === 2) { |
107 | + cou.empty = true; // 优惠券已抢光 | ||
108 | + } else if (status === 3) { | ||
109 | + cou.got = true; // 优惠券已领取 | ||
110 | + } | ||
114 | 111 | ||
115 | - result.categories.push(cou); | ||
116 | - } | ||
117 | - }); | 112 | + result.categories.push(cou); |
118 | } | 113 | } |
119 | }); | 114 | }); |
120 | } | 115 | } |
-
Please register or login to post a comment