From 141ef5c32872c9770cd54f3edf6c10bd9347226d Mon Sep 17 00:00:00 2001 From: tommy <3405129587@qq.com> Date: Wed, 3 Jun 2020 13:14:44 +0800 Subject: [PATCH] num --- config.json | 2 +- controllers/pc/lottery_draw.go | 12 ++++++------ models/sign_history.go | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config.json b/config.json index eba0c8a..1e77734 100644 --- a/config.json +++ b/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/*", diff --git a/controllers/pc/lottery_draw.go b/controllers/pc/lottery_draw.go index 11c5d50..49da783 100644 --- a/controllers/pc/lottery_draw.go +++ b/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() diff --git a/models/sign_history.go b/models/sign_history.go index ff4b1ff..67dbe89 100644 --- a/models/sign_history.go +++ b/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) }