Authored by yyq

Merge branch 'hotfix/shopCoupon' into gray

... ... @@ -183,8 +183,8 @@ exports.isFavoriteBrand = (req, res, next) => {
return next();
}
if (!req.body.brandId || !uid) {
return res.json({code: 400, message: '用户未登录或缺少参数'});
if (!req.body.brandId) {
return res.json({code: 400, message: '缺少参数'});
}
req.ctx(searchApi).isFavoriteBrand(uid, brandId).then(result => {
... ... @@ -207,8 +207,8 @@ exports.shopCouponSync = (req, res, next) => {
return next();
}
if (!id || !uid) {
return res.json({code: 400, message: '用户未登录或缺少参数'});
if (!id) {
return res.json({code: 400, message: '缺少参数'});
}
req.ctx(list).getUserCoupunStatus(id, uid, 'shop').then(result => {
... ...
... ... @@ -137,18 +137,18 @@ function syncCouponStatus() {
for (i = 0; i < info.length; i++) {
asyncObj[info[i].coupon_id] = info[i];
}
}
for (i in couponObj) {
if (couponObj.hasOwnProperty(i)) {
coup = asyncObj[i];
if (coup && (coup.status === 1 || coup.status === 3)) {
couponObj[i].status = coup.status;
coup.status === 3 ? setPicked(couponObj[i]) : false;
} else {
couponObj[i].status = 2; // 券不存在设置领取状态为已抢光
couponObj[i].dom.text('已抢光');
for (i in couponObj) {
if (couponObj.hasOwnProperty(i)) {
coup = asyncObj[i];
if (coup && (coup.status === 1 || coup.status === 3)) {
couponObj[i].status = coup.status;
coup.status === 3 ? setPicked(couponObj[i]) : false;
} else {
couponObj[i].status = 2; // 券不存在设置领取状态为已抢光
couponObj[i].dom.text('已抢光');
}
}
}
}
... ...