Showing
1 changed file
with
11 additions
and
1 deletions
@@ -27,7 +27,17 @@ class ActWheelSurfModel extends global.yoho.BaseModel { | @@ -27,7 +27,17 @@ class ActWheelSurfModel extends global.yoho.BaseModel { | ||
27 | data.conf = await ActWheelSurfConf.findOne({where: {act_id: obj.act_id}}); | 27 | data.conf = await ActWheelSurfConf.findOne({where: {act_id: obj.act_id}}); |
28 | 28 | ||
29 | // 获取当前活动奖品 | 29 | // 获取当前活动奖品 |
30 | - data.prize = await ActWheelSurfPrize.count({where: {act_id: obj.act_id}}); | 30 | + let prize = await ActWheelSurfPrize.findAll({where: {act_id: obj.act_id}}); |
31 | + | ||
32 | + data.prize = prize.length; | ||
33 | + data.emptyPrize = {}; | ||
34 | + | ||
35 | + for (let value of prize) { | ||
36 | + if (value.type === 1) { | ||
37 | + data.emptyPrize = value; | ||
38 | + break; | ||
39 | + } | ||
40 | + } | ||
31 | 41 | ||
32 | // this.cache.set(md5('act' + obj.act_id), data); | 42 | // this.cache.set(md5('act' + obj.act_id), data); |
33 | // } | 43 | // } |
-
Please register or login to post a comment