Showing
2 changed files
with
3 additions
and
2 deletions
1 | +const _ = require('lodash'); | ||
1 | const {Activity} = require('../../../db'); | 2 | const {Activity} = require('../../../db'); |
2 | const mysqlCli = global.yoho.utils.mysqlCli; | 3 | const mysqlCli = global.yoho.utils.mysqlCli; |
3 | 4 | ||
@@ -75,6 +76,7 @@ class ActWheelSurfModel extends global.yoho.BaseModel { | @@ -75,6 +76,7 @@ class ActWheelSurfModel extends global.yoho.BaseModel { | ||
75 | 76 | ||
76 | getActConf(actId) { | 77 | getActConf(actId) { |
77 | return this.client.hgetallAsync(`turntable:${actId}`).then(conf => { | 78 | return this.client.hgetallAsync(`turntable:${actId}`).then(conf => { |
79 | + conf = conf || {}; | ||
78 | Object.keys(conf).forEach(key => { | 80 | Object.keys(conf).forEach(key => { |
79 | if (conf[key] && !_.isNaN(Number(conf[key]))) { | 81 | if (conf[key] && !_.isNaN(Number(conf[key]))) { |
80 | conf[key] = Number(conf[key]) | 82 | conf[key] = Number(conf[key]) |
@@ -119,7 +119,6 @@ class ActWheelSurfModelRedis extends global.yoho.BaseModel { | @@ -119,7 +119,6 @@ class ActWheelSurfModelRedis extends global.yoho.BaseModel { | ||
119 | } | 119 | } |
120 | } | 120 | } |
121 | 121 | ||
122 | - // noinspection JSAnnotator | ||
123 | async goPrize(obj) { | 122 | async goPrize(obj) { |
124 | try { | 123 | try { |
125 | // 校验有效活动时间 | 124 | // 校验有效活动时间 |
@@ -287,7 +286,7 @@ class ActWheelSurfModelRedis extends global.yoho.BaseModel { | @@ -287,7 +286,7 @@ class ActWheelSurfModelRedis extends global.yoho.BaseModel { | ||
287 | getPrize = null; | 286 | getPrize = null; |
288 | for (let item of prize) { | 287 | for (let item of prize) { |
289 | if (item.type === 1) { | 288 | if (item.type === 1) { |
290 | - getPrize = item.dataValues; | 289 | + getPrize = item; |
291 | break; | 290 | break; |
292 | } | 291 | } |
293 | } | 292 | } |
-
Please register or login to post a comment