Authored by zhangxiaoru

channel

... ... @@ -7,11 +7,19 @@
const newsaleModel = require('../models/newsale');
const headerModel = require('../../../doraemon/models/header');
let channels = {
let yhchannels = {
'1,3': 1,
'2,3': 2
};
let channels = {
boys: 1,
girls: 2,
kids: 3,
lifestyle: 4
};
const index = (req, res, next) => {
let channel = req.yoho.channel || 'boys';
let codeKey = '';
... ... @@ -54,7 +62,8 @@ const selectHotrank = (req, res, next) => {
let limit = 50;
let page = req.query.page || 1;
let notab = req.query.notab || 0;
let yhChannel = req.query.gender && channels[req.query.gender] || 1;
let yhChannel = req.query.gender && yhchannels[req.query.gender] ||
req.cookies._Channel && channels[req.cookies._Channel] || 1;
newsaleModel.selectHotrank(yhChannel, sort, tab_id, limit, page, notab).then((result) => {
... ...