Authored by yyq

fix individuation-review by wenxue

@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 const _ = require('lodash'); 2 const _ = require('lodash');
3 const UfoApi = global.yoho.UfoAPI; 3 const UfoApi = global.yoho.UfoAPI;
4 4
5 -let _getProduct = function(o) { 5 +let _getProduct = function(o, type) {
6 let plan = o.product_price_plan_list; 6 let plan = o.product_price_plan_list;
7 let res = { 7 let res = {
8 small_sort_id: o.small_sort_id, 8 small_sort_id: o.small_sort_id,
@@ -25,7 +25,8 @@ let _getProduct = function(o) { @@ -25,7 +25,8 @@ let _getProduct = function(o) {
25 cn_alphabet: o.cn_alphabet, 25 cn_alphabet: o.cn_alphabet,
26 default_images: o.default_images, 26 default_images: o.default_images,
27 total_sales_num: o.total_sales_num || 0, 27 total_sales_num: o.total_sales_num || 0,
28 - goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : void 0 28 + goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : void 0,
  29 + type: type || 'yoho'
29 }; 30 };
30 31
31 plan = _.sortBy(plan, item => { 32 plan = _.sortBy(plan, item => {
@@ -112,9 +113,13 @@ class individuationModel extends global.yoho.BaseModel { @@ -112,9 +113,13 @@ class individuationModel extends global.yoho.BaseModel {
112 113
113 list.forEach(function(o) { 114 list.forEach(function(o) {
114 if (o) { 115 if (o) {
115 - o.sales_price = o.price;  
116 - o.market_price = 0;  
117 - data.push(_getProduct(o)); 116 + Object.assign(o, {
  117 + product_id: o.id,
  118 + sales_price: o.price,
  119 + market_price: 0,
  120 + total_sales_num: o.sales
  121 + });
  122 + data.push(_getProduct(o, 'ufo'));
118 } 123 }
119 }); 124 });
120 125
@@ -318,7 +318,7 @@ if (isProduction) { @@ -318,7 +318,7 @@ if (isProduction) {
318 'http://global-test-soa.yohops.com:9999/', 318 'http://global-test-soa.yohops.com:9999/',
319 store: 319 store:
320 process.env.TEST_STORE || 320 process.env.TEST_STORE ||
321 - 'http://192.168.102.210:8080/portal-gateway/wechat/', 321 + 'http://192.168.102.47:8080/portal-gateway/wechat/',
322 liveApi: 322 liveApi:
323 process.env.TEST_LIVE || 'http://testapi.live.yohops.com:9999/', 323 process.env.TEST_LIVE || 'http://testapi.live.yohops.com:9999/',
324 imSocket: 324 imSocket: