Authored by 周少峰

Merge branch 'feature/couponStatus' into release/6.1

... ... @@ -95,26 +95,21 @@ exports.getCouponStatus = (params) => {
break;
}
coupon.data.forEach(function(val) {
if (val.template_name === 'getCoupon' && val.data.length) {
// 优惠券楼层
val.data.forEach(function(item) {
const status = Number(item.status);
coupon.data.forEach(function(item) {
const status = Number(item.status);
if ([2, 3].indexOf(status) > -1) {
const cou = {
id: crypto.encryption('yoho9646abcdefgh', item.couponID) // 加密优惠券号
};
if ([2, 3].indexOf(status) > -1) {
const cou = {
id: crypto.encryption('yoho9646abcdefgh', item.couponId) // 加密优惠券号
};
if (status === 2) {
cou.empty = true; // 优惠券已抢光
} else if (status === 3) {
cou.got = true; // 优惠券已领取
}
if (status === 2) {
cou.empty = true; // 优惠券已抢光
} else if (status === 3) {
cou.got = true; // 优惠券已领取
}
result.categories.push(cou);
}
});
result.categories.push(cou);
}
});
}
... ...