Authored by 周少峰

Merge branch 'release/6.1' into gray

@@ -83,7 +83,7 @@ exports.getCouponData = (channel, params) => { @@ -83,7 +83,7 @@ exports.getCouponData = (channel, params) => {
83 exports.getCouponStatus = (params) => { 83 exports.getCouponStatus = (params) => {
84 return Promise.coroutine(function*() { 84 return Promise.coroutine(function*() {
85 const coupon = yield api.get('', Object.assign(params, { 85 const coupon = yield api.get('', Object.assign(params, {
86 - method: 'app.promotion.queryCouponCenter' 86 + method: 'app.promotion.couponStatus'
87 })); 87 }));
88 const result = { 88 const result = {
89 code: coupon.code, 89 code: coupon.code,
@@ -95,15 +95,12 @@ exports.getCouponStatus = (params) => { @@ -95,15 +95,12 @@ 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) { 98 + coupon.data.forEach(function(item) {
102 const status = Number(item.status); 99 const status = Number(item.status);
103 100
104 if ([2, 3].indexOf(status) > -1) { 101 if ([2, 3].indexOf(status) > -1) {
105 const cou = { 102 const cou = {
106 - id: crypto.encryption('yoho9646abcdefgh', item.couponID) // 加密优惠券号 103 + id: crypto.encryption('yoho9646abcdefgh', String(item.couponId)) // 加密优惠券号
107 }; 104 };
108 105
109 if (status === 2) { 106 if (status === 2) {
@@ -116,8 +113,6 @@ exports.getCouponStatus = (params) => { @@ -116,8 +113,6 @@ exports.getCouponStatus = (params) => {
116 } 113 }
117 }); 114 });
118 } 115 }
119 - });  
120 - }  
121 while (false); 116 while (false);
122 return result; 117 return result;
123 })(); 118 })();