Authored by 郭成尧

data-process-to-controller

@@ -331,8 +331,11 @@ const listNew = (req, res, next) => { @@ -331,8 +331,11 @@ const listNew = (req, res, next) => {
331 if (uid) { 331 if (uid) {
332 initialData.uid = uid; 332 initialData.uid = uid;
333 } 333 }
  334 +
  335 + let searchParams = searchProcess.getSearchParamsWithoutMethod(initialData);
  336 +
334 co(function* () { 337 co(function* () {
335 - let result = yield req.ctx(searchModel).getCategoryGoods(initialData); 338 + let result = yield req.ctx(searchModel).getCategoryGoods(searchParams);
336 let categoryIntroRedis = []; 339 let categoryIntroRedis = [];
337 340
338 let responseResult = { 341 let responseResult = {
@@ -390,7 +393,7 @@ const listNew = (req, res, next) => { @@ -390,7 +393,7 @@ const listNew = (req, res, next) => {
390 }; 393 };
391 394
392 /** 395 /**
393 - * 品类落地页异步获取商品数据 396 + * SEO 友好的品类落地页异步获取商品数据
394 */ 397 */
395 const getCategoryGoods = (req, res, next) => { 398 const getCategoryGoods = (req, res, next) => {
396 let allowOrigin = _.get(req, 'headers.origin', null) ? 399 let allowOrigin = _.get(req, 'headers.origin', null) ?
@@ -413,7 +416,9 @@ const getCategoryGoods = (req, res, next) => { @@ -413,7 +416,9 @@ const getCategoryGoods = (req, res, next) => {
413 params.isApp = req.yoho.isApp; 416 params.isApp = req.yoho.isApp;
414 params.limit = 24; 417 params.limit = 24;
415 418
416 - req.ctx(searchModel).getCategoryGoods(params).then((result) => { 419 + let searchParams = searchProcess.getSearchParamsWithoutMethod(params);
  420 +
  421 + req.ctx(searchModel).getCategoryGoods(searchParams).then((result) => {
417 if (result.data.product_list && result.data.product_list.length > 0) { 422 if (result.data.product_list && result.data.product_list.length > 0) {
418 423
419 let product_list = productProcess.processProductList(result.data.product_list || [], { 424 let product_list = productProcess.processProductList(result.data.product_list || [], {
@@ -323,7 +323,7 @@ module.exports = class extends global.yoho.BaseModel { @@ -323,7 +323,7 @@ module.exports = class extends global.yoho.BaseModel {
323 method: 'web.search.search' 323 method: 'web.search.search'
324 }; 324 };
325 325
326 - _.assign(requestData, searchProcess.getSearchParamsWithoutMethod(params)); 326 + _.assign(requestData, params);
327 return this.get({ 327 return this.get({
328 data: requestData 328 data: requestData
329 }); 329 });