Authored by 沈志敏

Merge branch 'feature/individuation' into feature/download_individate

1 'use strict'; 1 'use strict';
2 const model = require('../models/individuation'); 2 const model = require('../models/individuation');
  3 +const channels = {
  4 + boys: 1,
  5 + girl: 2,
  6 + kids: 3,
  7 + lifestyle: 4
  8 +};
3 9
4 exports.productLst = function(req, res, next) { 10 exports.productLst = function(req, res, next) {
5 let keys = ['sort', 'misort', 'msort', 'gender', 'brand'], 11 let keys = ['sort', 'misort', 'msort', 'gender', 'brand'],
@@ -8,7 +14,9 @@ exports.productLst = function(req, res, next) { @@ -8,7 +14,9 @@ exports.productLst = function(req, res, next) {
8 uid: req.query.uid, 14 uid: req.query.uid,
9 udid: req.query.udid, 15 udid: req.query.udid,
10 promotion: req.query.pid, 16 promotion: req.query.pid,
  17 + yh_channel: req.query.yh_channel || (req.cookies._Channel && channels[req.cookies._Channel]) || 1,
11 specified_sort: req.query.enum, 18 specified_sort: req.query.enum,
  19 + stocknumber: req.query.sn,
12 p_d: req.query.pd, 20 p_d: req.query.pd,
13 limit: req.query.limit || 10 21 limit: req.query.limit || 10
14 }; 22 };
@@ -11,6 +11,8 @@ let _getProduct = function(o) { @@ -11,6 +11,8 @@ let _getProduct = function(o) {
11 middle_sort_id: o.middle_sort_id, 11 middle_sort_id: o.middle_sort_id,
12 max_sort_id: o.max_sort_id, 12 max_sort_id: o.max_sort_id,
13 brand_id: o.brand_id, 13 brand_id: o.brand_id,
  14 + shop_id: o.shop_id,
  15 + shop_template_type: o.shop_template_type,
14 brand_domain: o.brand_domain, 16 brand_domain: o.brand_domain,
15 brand_name: o.brand_name, 17 brand_name: o.brand_name,
16 product_id: o.product_id, 18 product_id: o.product_id,
@@ -20,7 +22,7 @@ let _getProduct = function(o) { @@ -20,7 +22,7 @@ let _getProduct = function(o) {
20 sales_price: o.sales_price, 22 sales_price: o.sales_price,
21 cn_alphabet: o.cn_alphabet, 23 cn_alphabet: o.cn_alphabet,
22 default_images: o.default_images, 24 default_images: o.default_images,
23 - goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : '' 25 + goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : undefined
24 }; 26 };
25 }; 27 };
26 28