Authored by 李奇

Merge remote-tracking branch 'origin/feature/trans-redis' into feature/trans-redis

# Conflicts:
#	apps/api/models/wheel-surf.js
... ... @@ -373,7 +373,7 @@ class ActWheelSurfModelRedis extends global.yoho.BaseModel {
}
if (!obj.act_id) {
return [];
return {};
}
try {
... ... @@ -386,17 +386,22 @@ class ActWheelSurfModelRedis extends global.yoho.BaseModel {
`select u.id, u.act_id act_id, u.prize_id prize_id, u.create_time createTime, p.name name,p.type type ,p.value value,p.img img
from act_wheel_surf_user u , act_wheel_surf_prize p where u.prize_id = p.id and u.act_id =:act_id and u.uid = :uid and type != :type
order by u.create_time desc`, {act_id: obj.act_id, uid: obj.uid, type: 1});
oddPrizes = oddPrizes.map(prize => {
});
} catch(e) {
logger.error(e);
}
return this.client.zrevrangeAsync(`turntable:${obj.act_id}:user:${obj.uid}:prize`, 0, 300)
.then(prizes => {
prizes = prizes.concat(oddPrizes);
return prizes.map(prize => {
return JSON.parse(prize.split(':::')[0]);
}).filter(prize => {
return prize.type !== 1;
}).concat(oddPrizes);
});
});
} else {
return await this.client.zrevrangeAsync(`turntable:${obj.act_id}:user:${obj.uid}:prize`, 0, 300)
... ...