Authored by yyq

fix fav brand

... ... @@ -217,13 +217,25 @@ module.exports = class favorite extends global.yoho.BaseModel {
}
result.brands = _.get(brand, 'data.brand_list', []).map((item) => {
let url = '';
switch (item.brandOrShopType) {
case 'shop':
url = helpers.urlFormat(`/shop/${item.brand_domain}-${item.shop_id}.html`, null);
break;
case 'brand':
url = helpers.urlFormat(`/search/`, {brand: item.brand_id});
break;
default:
break;
}
return {
id: item.brand_id,
brandOrShopType: item.brandOrShopType || '',
shop_id: item.shop_id || '',
img: helpers.image(item.brand_ico, 100, 100),
url: helpers.urlFormat(`/shop/${item.brand_domain}-${item.shop_id}.html`, null),
url: url,
name: item.brand_name,
naCount: item.new_product_num,
colCount: item.brand_favorite_num
... ...