Authored by yyq

recomend

... ... @@ -131,17 +131,21 @@ module.exports = class extends global.yoho.BaseModel {
getListRecommend(actPrizeId, extra = {}) {
const actId = parseInt(extra.actId, 10) || 0;
actPrizeId = parseInt(actPrizeId, 10) || 0;
let lid = parseInt(actPrizeId, 10) || 0;
return mysqlCli.query(`select * from ${TABLE_ACT_PRIZE_PRODUCT}
where act_id = :actId and id > :actPrizeId and status > 0
order by sort desc limit 5`, {
actId,
actPrizeId: actPrizeId - 3
actPrizeId: lid - 3
}, {
cache: PRODUCT_CACHE_TIMES
}).then(result => {
return handelResult(handelActivityList(result));
_.remove(result, n => {
return +n.id === +actPrizeId;
});
return handelResult(handelActivityList(_.takeRight(result, 2)));
});
}
... ...