...
|
...
|
@@ -10,6 +10,7 @@ const _ = require('lodash'); |
|
|
const helpers = global.yoho.helpers;
|
|
|
const searchModel = require('./search');
|
|
|
const productProcess = require(`${utils}/product-process`);
|
|
|
const listParamsProcess = require(`${utils}/list-params-process`);
|
|
|
const stringProcess = require(`${global.utils}/string-process`);
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -771,23 +772,21 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
});
|
|
|
|
|
|
_.forEach(value.sub, (subValue, subKey) => {
|
|
|
value.sub[subKey].url = helpers.urlFormat('', {
|
|
|
value.sub[subKey].url = listParamsProcess.generatePathUrl({
|
|
|
shop_id: params.shopId,
|
|
|
sort: _.get(subValue, 'relation_parameter.sort', ''),
|
|
|
title: subValue.category_name,
|
|
|
query: subValue.category_name
|
|
|
}, 'search');
|
|
|
title: subValue.category_name
|
|
|
}, `shop/${params.domain}-${params.shopId}`);
|
|
|
});
|
|
|
|
|
|
let subCategory = [
|
|
|
{
|
|
|
category_name: '全部' + value.category_name,
|
|
|
url: helpers.urlFormat('', {
|
|
|
url: listParamsProcess.generatePathUrl({
|
|
|
shop_id: params.shopId,
|
|
|
sort: _.get(value, 'relation_parameter.sort', ''),
|
|
|
title: '全部' + value.category_name,
|
|
|
query: value.category_name
|
|
|
}, 'search')
|
|
|
title: '全部' + value.category_name
|
|
|
}, `shop/${params.domain}-${params.shopId}`)
|
|
|
}
|
|
|
];
|
|
|
|
...
|
...
|
@@ -798,9 +797,9 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
});
|
|
|
});
|
|
|
|
|
|
finalResult.allProduct = helpers.urlFormat('', {
|
|
|
shop_id: params.shopId
|
|
|
}, 'search');
|
|
|
finalResult.allProduct = listParamsProcess.generatePathUrl({
|
|
|
title: '全部商品'
|
|
|
}, `shop/${params.domain}-${params.shopId}`);
|
|
|
|
|
|
return finalResult;
|
|
|
});
|
...
|
...
|
|