Authored by shuaiguo

类目查询

... ... @@ -41,8 +41,16 @@ exports.index = (req, res, next) => {
logger.debug(`decodeURIComponent query fail:${e.toString()}`);
}
let channel = req.query.channel || 'boys';
if (req.url.indexOf('gd2') > -1) {
channel = 'girls';
} else if (req.url.indexOf('gd1') > -1) {
channel = 'boys';
}
req.ctx(list).getListData(Object.assign(req.query, {uid: req.user.uid, prid: req.user.prid}),
req.yoho.channel).then(result => {
channel || req.yoho.channel).then(result => {
Object.assign(resData, result, {
pageClass: 'static-list-page'
});
... ... @@ -77,8 +85,10 @@ exports.index = (req, res, next) => {
*/
exports.new = (req, res, next) => {
let resData = {};
const channel = req.query.channel || 'boys';
req.ctx(list).getListNewData(Object.assign({order: 's_t_desc'}, req.query), req.yoho.channel).then(result => {
// eslint-disable-next-line max-len
req.ctx(list).getListNewData(Object.assign({order: 's_t_desc'}, req.query), channel || req.yoho.channel).then(result => {
Object.assign(resData, result, {
hideInfo: {from: 'newProduct'},
pageClass: 'static-list-page'
... ... @@ -100,7 +110,7 @@ exports.new = (req, res, next) => {
* @return {[type]} [description]
*/
exports.newWithChannel = (req, res, next) => {
let channel = req.pathChannel || req.yoho.channel;
let channel = req.query.channel || req.pathChannel || req.yoho.channel;
req.query = req.query || {};
... ...
{
"name": "yohobuy-node",
"version": "6.10.5",
"version": "6.10.6",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...