...
|
...
|
@@ -2,7 +2,7 @@ |
|
|
const _ = require('lodash');
|
|
|
const UfoApi = global.yoho.UfoAPI;
|
|
|
|
|
|
let _getProduct = function(o) {
|
|
|
let _getProduct = function(o, type) {
|
|
|
let plan = o.product_price_plan_list;
|
|
|
let res = {
|
|
|
small_sort_id: o.small_sort_id,
|
...
|
...
|
@@ -25,7 +25,8 @@ let _getProduct = function(o) { |
|
|
cn_alphabet: o.cn_alphabet,
|
|
|
default_images: o.default_images,
|
|
|
total_sales_num: o.total_sales_num || 0,
|
|
|
goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : void 0
|
|
|
goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : void 0,
|
|
|
type: type || 'yoho'
|
|
|
};
|
|
|
|
|
|
plan = _.sortBy(plan, item => {
|
...
|
...
|
@@ -112,9 +113,13 @@ class individuationModel extends global.yoho.BaseModel { |
|
|
|
|
|
list.forEach(function(o) {
|
|
|
if (o) {
|
|
|
o.sales_price = o.price;
|
|
|
o.market_price = 0;
|
|
|
data.push(_getProduct(o));
|
|
|
Object.assign(o, {
|
|
|
product_id: o.id,
|
|
|
sales_price: o.price,
|
|
|
market_price: 0,
|
|
|
total_sales_num: o.sales
|
|
|
});
|
|
|
data.push(_getProduct(o, 'ufo'));
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
|