Authored by 毕凯

Merge branch 'hotfix/chanpin' into 'master'

Hotfix/chanpin



See merge request !951
... ... @@ -128,7 +128,7 @@
<div class="brand-div">
<span class="brand-name"{{#if ../fontColor}}style="color:{{../fontColor}};"{{/if}}>{{brandname}}</span>
</div>
<img class="brand-img lazy" data-original="{{image2 ../brandImg q=95}}">
<img class="brand-img" src="{{image2 ../brandImg q=95}}">
</a>
{{/if}}
</div>
... ...
... ... @@ -8,6 +8,7 @@ const bundle = require('./bundle');
const utils = '../../../utils';
const detailProcess = require(`${utils}/detail-process`);
const redis = require(`${utils}/redis`);
const logger = global.yoho.logger;
// const api = global.yoho.API;
const helpers = global.yoho.helpers;
... ... @@ -62,7 +63,12 @@ module.exports = class extends global.yoho.BaseModel {
return this.getRecomdKeywords(smallSort).then(res => {
let recomdKeywords = [];
res = res ? JSON.parse(res) : [];
try {
res = res ? JSON.parse(res) : [];
} catch (e) {
logger.error(`smallSort: ${smallSort}, message: ${e.message}`);
res = [];
}
_.forEach(_.slice(_.shuffle(res), 0, 12), val => {
recomdKeywords.push({
... ...
... ... @@ -612,7 +612,7 @@ const getSearchKeywordDataById = (id, params, uid) => {
});
});
_.set(result, 'fuzzyWord', redisData.data);
_.set(result, 'fuzzyWord', tdata);
}
return result;
... ...