黄梓健 5 years ago
parent
commit
141ef5c328
  1. 2
      config.json
  2. 12
      controllers/pc/lottery_draw.go
  3. 2
      models/sign_history.go

2
config.json

@ -1,6 +1,6 @@
{
"port": "20181",
"host": "127.0.0.1",
"host": "192.168.1.103",
"cross_domain": "*",
"post_max_memory": 1024000,
"api_router": "/PcClient/*",

12
controllers/pc/lottery_draw.go

@ -117,9 +117,9 @@ func (t *LotteryDrawCtl) StopRoll() {
t.CheckErr(err)
t.Assert(exist, code.MSG_LOTTERY_RULE_NOT_EXIST, "抽奖规则不存在")
if ladder.Status != define.StatusRunning {
t.ERROR(fmt.Sprintf("该活动%s", ladder.Status), code.MSG_ERR)
}
//if ladder.Status != define.StatusRunning {
// t.ERROR(fmt.Sprintf("该活动%s", ladder.Status), code.MSG_ERR)
//}
// 通知直播开始抽奖
if activity.RehearsalId == 0 {
live := new(models.LiveConfig)
@ -155,9 +155,9 @@ func (t *LotteryDrawCtl) Stop() {
t.CheckErr(err)
t.Assert(exist, code.MSG_LOTTERY_RULE_NOT_EXIST, "抽奖规则不存在")
if ladder.Status != define.StatusRunning {
t.ERROR(fmt.Sprintf("该活动%s", ladder.Status), code.MSG_ERR)
}
//if ladder.Status != define.StatusRunning {
// t.ERROR(fmt.Sprintf("该活动%s", ladder.Status), code.MSG_ERR)
//}
ladder.Status = define.StatusEnding
ladder.UpdatedAt = time.Now()

2
models/sign_history.go

@ -36,7 +36,7 @@ func (t *SignHistory) GetByUserId(aid, uid, rid, arid int64) (bool, error) {
func (t *SignHistory) Count(signUpId, activityId, rehearsalId interface{}) (int64, error) {
// 签到人数
return core.GetXormAuto().Where("is_delete=0 and sign_rule_id=? and rehearsal_id=? and activity_id=?",
return core.GetXormAuto().Where("is_delete=0 and sign_rule_id=? and rehearsal_id=? and activity_id=? and status=2",
signUpId, rehearsalId, activityId).Count(t)
}

Loading…
Cancel
Save