...
|
...
|
@@ -92,6 +92,26 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 0元购用户推荐列表
|
|
|
* @param uid
|
|
|
* @param extra
|
|
|
* @returns {*}
|
|
|
*/
|
|
|
getListRecommend(actPrizeId, extra = {}) {
|
|
|
const actId = parseInt(extra.actId, 10) || 0;
|
|
|
|
|
|
actPrizeId = parseInt(actPrizeId, 10) || 0;
|
|
|
|
|
|
return mysqlCli.query(`select * from ${TABLE_ACT_PRIZE_PRODUCT}
|
|
|
where act_id = :actId and id > :actPrizeId and status > 0 limit 5`, {
|
|
|
actId,
|
|
|
actPrizeId: actPrizeId - 3
|
|
|
}, {
|
|
|
cache: PRODUCT_CACHE_TIMES
|
|
|
}).then(handelResult);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 0元购详情
|
|
|
* @param actPrizeId
|
|
|
* @returns {*}
|
...
|
...
|
@@ -190,11 +210,14 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
return errorData;
|
|
|
}
|
|
|
|
|
|
if (uid === +extra.shareUid) {
|
|
|
delete extra.shareUid;
|
|
|
}
|
|
|
|
|
|
if (extra.shareUid) {
|
|
|
this.sendPrizeCode(extra.shareUid, actPrizeId, {isShareTake: true});
|
|
|
}
|
|
|
|
|
|
|
|
|
return this.sendPrizeCode(uid, actPrizeId, Object.assign(extra, {isShareTake: false}));
|
|
|
}
|
|
|
|
...
|
...
|
|