Authored by 陈峰

Merge branch 'hotfix/coupons' into 'master'

Hotfix/coupons



See merge request !266
... ... @@ -75,7 +75,8 @@ module.exports = class extends global.yoho.BaseModel {
value.toUse = helpers.urlFormat(handleFilterUrl('/list', {
cpc_id: value.coupon_id,
coupon_code: value.coupon_code,
phrase: `以下商品可使用【${value.coupon_name}】优惠券`
phrase: `以下商品可使用【${value.coupon_name}】优惠券`,
status: 1
}));
}
});
... ...
... ... @@ -10,7 +10,7 @@ const helpers = global.yoho.helpers;
const logger = global.yoho.logger;
const _ = require('lodash');
const handleFilterUrl = require(`${global.utils}/parameter`).fullParamToMinPath;
// const handleFilterUrl = require(`${global.utils}/parameter`).fullParamToMinPath;
// 搜索相关接口
const searchApi = require('../models/search-api');
... ... @@ -26,14 +26,14 @@ exports.index = (req, res, next) => {
let resData = {};
let qs = '';
if (req.originalUrl && req.originalUrl.indexOf('.html') < 0 &&
!_.isEmpty(req.query)) {
let rUrl = handleFilterUrl('/list', req.query);
// if (req.originalUrl && req.originalUrl.indexOf('.html') < 0 &&
// req.originalUrl.indexOf('?') < 0 && !_.isEmpty(req.query)) {
// let rUrl = handleFilterUrl('/list', req.query);
if (rUrl !== req.originalUrl) {
return res.redirect(301, helpers.urlFormat(rUrl));
}
}
// if (rUrl !== req.originalUrl) {
// return res.redirect(301, helpers.urlFormat(rUrl));
// }
// }
try {
qs = decodeURIComponent(req._parsedOriginalUrl.query || '');
... ...