Authored by 郭成尧

'reference-for0u'

... ... @@ -137,13 +137,9 @@ exports.intro = (req, res, next) => {
*/
exports.preference = (req, res, next) => {
preferenceModel({
productskn: req.query.productSkn,
yhchannel: req.yoho.channel,
brandId: req.query.brandId
productskn: req.query.productSkn
}).then((result) => {
res.render('detail/preference', Object.assign({
layout: false
}, result));
res.send(result);
}).catch(next);
};
... ...
... ... @@ -48,18 +48,11 @@ const _formatProduct = (data) => {
};
module.exports = (data) => {
let finalResult = {};
return api.get('', {
method: 'h5.preference.Search',
productskn: data.productskn,
yhchannel: yhchannelMap[data.yhchannel],
brandId: data.brandId
method: 'app.product.preference',
product_skn: data.productskn,
limit: data.limit || '20'
}).then(result => {
if (result) {
finalResult.recommendList = _formatProduct(result);
}
return finalResult;
return result;
});
};
... ...