Authored by OF1706

channelNum

... ... @@ -147,7 +147,7 @@ const searchHistory = (req, res) => {
* 搜索少或无 有可能喜欢
**/
const searchLessRecommend = (req, res, next) => {
let channel = req.yoho.channel;
let channelNum = req.yoho.channelNum;
let uid = req.user.uid;
let udid = req.yoho.udid;
let page = Number(req.query.page || 1);
... ... @@ -156,7 +156,7 @@ const searchLessRecommend = (req, res, next) => {
page = 1;
}
search.getSearchLessProduct(channel, uid, udid, page).then(result => {
search.getSearchLessProduct(channelNum, uid, udid, page).then(result => {
return res.send(result);
}).catch(next);
... ...
... ... @@ -431,10 +431,10 @@ const getBrands4Filter = (params) => {
* @return array 接口返回的数据
* */
const lessRecommend = (channel, uid, udid, recPos, limit) => {
const lessRecommend = (channelNum, uid, udid, recPos, limit) => {
let param = {
method: 'app.search.newLast7day',
yh_channel: channel,
yh_channel: channelNum,
udid: udid,
rec_pos: recPos,
limit: limit
... ...
... ... @@ -230,7 +230,7 @@ exports.getBrands4Filter = (params) => {
* @return array
* */
exports.getSearchLessProduct = (channel, uid, udid, page) => {
exports.getSearchLessProduct = (channelNum, uid, udid, page) => {
return co(function * () {
let result = {
... ... @@ -247,28 +247,6 @@ exports.getSearchLessProduct = (channel, uid, udid, page) => {
}
};
let channelNum = 1;
if (!_.isNumber(page)) {
return result;
}
switch (channel) {
case 'boys':
channelNum = 1;
break;
case 'girls':
channelNum = 2;
break;
case 'kids':
channelNum = 3;
break;
case 'lifestyle':
channelNum = 3;
break;
default:
break;
}
if (!_.isNumber(page)) {
return result;
}
... ...
... ... @@ -226,8 +226,9 @@ exports.requestHeaderData = (type) => {
case 'girls':
return 2;
case 'kids':
case 'lifestyle':
return 3;
case 'lifestyle':
return 4;
default:
return 1;
}
... ...