Authored by ccbikai

品类数据处理

... ... @@ -15,7 +15,7 @@ let index = (req, res, next) => {
pageHeader: headerModel.setNav({
navTitle: '商品分类'
}),
pageFooter: true,
pageFooter: false,
category: {
nav: result.nav,
list: result.list,
... ...
... ... @@ -36,14 +36,23 @@ let _processCateData = (list, channel) => {
if (firstItem.sub && firstItem.sub.length) {
_.map(firstItem.sub, function(secondItem) {
secondItem.url = helpers.urlFormat('/', {
sort: secondItem.categoryId,
sort: _.get(secondItem, 'relationParameter.sort'),
sort_name: secondItem.categoryName,
gender: genderMap[channel] || ''
}, 'list');
});
firstItem.sub.unshift({
categoryName: `全部${firstItem.categoryName}`,
url: helpers.urlFormat('/', {
sort: _.get(firstItem, 'relationParameter.sort'),
sort_name: firstItem.categoryName,
gender: genderMap[channel] || ''
}, 'list')
});
} else {
firstItem.url = helpers.urlFormat('/', {
sort: firstItem.categoryId,
sort: _.get(firstItem, 'relationParameter.sort'),
sort_name: firstItem.categoryName,
gender: genderMap[channel] || ''
}, 'list');
... ...