Authored by yyq

Merge branch 'feature/1215' into release/6.9.17

... ... @@ -24,6 +24,25 @@ exports.productLst = function(req, res, next) {
order: req.query.order || 'pool_id_desc',
filter_poolId: req.query.filter_poolId || ''
}, req.query));
} else if (req.query.is_ufo === 'Y') {
let keys = ['product_id', 'productPool', 'sort', 'brand', 'series', 'size'];
let params = {
uid: uid,
udid: udid,
limit: 20
};
keys.forEach(function(k) {
if (req.query[k]) {
params[k] = req.query[k];
}
});
if (req.query.limit < 100) {
params.limit = req.query.limit;
}
getProductList = req.ctx(model).ufoProductList(params);
} else {
let keys = ['sort', 'misort', 'msort', 'gender', 'brand'],
params = {
... ...
'use strict';
const _ = require('lodash');
const UfoApi = global.yoho.UfoAPI;
let _getProduct = function(o) {
let plan = o.product_price_plan_list;
... ... @@ -99,6 +100,27 @@ class individuationModel extends global.yoho.BaseModel {
return data;
});
}
ufoProductList(params) {
return this.get({
data: Object.assign({
method: 'ufo.product.search.common.list'
}, params),
api: UfoApi
}).then(res => {
let data = [],
list = (res && res.data && res.data.product_list) || [];
list.forEach(function(o) {
if (o) {
o.sales_price = o.price;
o.market_price = 0;
data.push(_getProduct(o));
}
});
return data;
});
}
getCoupon(params) {
return this.get({
data: Object.assign({
... ...