Authored by 郭成尧

brand-api-data-struct-change

... ... @@ -185,13 +185,14 @@ module.exports = class extends global.yoho.BaseModel {
};
allList[key].forEach(row => {
obj.list.push({
name: row.brand_name,
isHot: row.is_hot === 'Y' ? true : false,
isNew: row.is_show_new === 'Y' ? true : false,
url: this._urlJump(parseInt(row.type, 10), row)
});
if (row) {
obj.list.push({
name: _.get(row, 'brand_name', ''),
isHot: _.get(row, 'is_hot') === 'Y' ? true : false,
isNew: _.get(row, 'is_show_new') === 'Y' ? true : false,
url: this._urlJump(parseInt(row.type, 10), row)
});
}
});
resu.brandList.push(obj);
}
... ... @@ -207,9 +208,9 @@ module.exports = class extends global.yoho.BaseModel {
};
obj.list.push({
brandName: newList[key].brand_name,
url: this._urlJump(parseInt(newList[key].type, 10), newList[key]),
img: helpers.image(newList[key].brand_ico, 186, 115),
brandName: _.get(newList, `${key}.brand_name`, ''),
url: this._urlJump(parseInt(_.get(newList, `${key}.type`), 10), _.get(newList, `${key}`)),
img: helpers.image(_.get(newList, `${key}.brand_ico`), 186, 115),
});
resu.newBrandWall.push(obj);
}
... ...