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 { @@ -75,7 +75,8 @@ module.exports = class extends global.yoho.BaseModel {
75 value.toUse = helpers.urlFormat(handleFilterUrl('/list', { 75 value.toUse = helpers.urlFormat(handleFilterUrl('/list', {
76 cpc_id: value.coupon_id, 76 cpc_id: value.coupon_id,
77 coupon_code: value.coupon_code, 77 coupon_code: value.coupon_code,
78 - phrase: `以下商品可使用【${value.coupon_name}】优惠券` 78 + phrase: `以下商品可使用【${value.coupon_name}】优惠券`,
  79 + status: 1
79 })); 80 }));
80 } 81 }
81 }); 82 });
@@ -10,7 +10,7 @@ const helpers = global.yoho.helpers; @@ -10,7 +10,7 @@ const helpers = global.yoho.helpers;
10 const logger = global.yoho.logger; 10 const logger = global.yoho.logger;
11 const _ = require('lodash'); 11 const _ = require('lodash');
12 12
13 -const handleFilterUrl = require(`${global.utils}/parameter`).fullParamToMinPath; 13 +// const handleFilterUrl = require(`${global.utils}/parameter`).fullParamToMinPath;
14 14
15 // 搜索相关接口 15 // 搜索相关接口
16 const searchApi = require('../models/search-api'); 16 const searchApi = require('../models/search-api');
@@ -26,14 +26,14 @@ exports.index = (req, res, next) => { @@ -26,14 +26,14 @@ exports.index = (req, res, next) => {
26 let resData = {}; 26 let resData = {};
27 let qs = ''; 27 let qs = '';
28 28
29 - if (req.originalUrl && req.originalUrl.indexOf('.html') < 0 &&  
30 - !_.isEmpty(req.query)) {  
31 - let rUrl = handleFilterUrl('/list', req.query); 29 + // if (req.originalUrl && req.originalUrl.indexOf('.html') < 0 &&
  30 + // req.originalUrl.indexOf('?') < 0 && !_.isEmpty(req.query)) {
  31 + // let rUrl = handleFilterUrl('/list', req.query);
32 32
33 - if (rUrl !== req.originalUrl) {  
34 - return res.redirect(301, helpers.urlFormat(rUrl));  
35 - }  
36 - } 33 + // if (rUrl !== req.originalUrl) {
  34 + // return res.redirect(301, helpers.urlFormat(rUrl));
  35 + // }
  36 + // }
37 37
38 try { 38 try {
39 qs = decodeURIComponent(req._parsedOriginalUrl.query || ''); 39 qs = decodeURIComponent(req._parsedOriginalUrl.query || '');