|
@ -43,6 +43,10 @@ func (t *LotteryDrawCtl) Start() { |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
// 通知直播开始抽奖
|
|
|
// 通知直播开始抽奖
|
|
|
if activity.RehearsalId == 0 { |
|
|
if activity.RehearsalId == 0 { |
|
|
|
|
|
live := new(models.LiveConfig) |
|
|
|
|
|
exist, err := live.GetByActivityId(activity.Id) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
if exist && live.HaveModule(define.MODULE_LOTTERY) { |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawStart, |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawStart, |
|
|
map[string]interface{}{ |
|
|
map[string]interface{}{ |
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
@ -50,6 +54,7 @@ func (t *LotteryDrawCtl) Start() { |
|
|
"desc": "开始抽奖", |
|
|
"desc": "开始抽奖", |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
t.SUCCESS("操作成功") |
|
|
t.SUCCESS("操作成功") |
|
|
} |
|
|
} |
|
@ -79,6 +84,10 @@ func (t *LotteryDrawCtl) StartRoll() { |
|
|
|
|
|
|
|
|
// 通知直播开始抽奖
|
|
|
// 通知直播开始抽奖
|
|
|
if activity.RehearsalId == 0 { |
|
|
if activity.RehearsalId == 0 { |
|
|
|
|
|
live := new(models.LiveConfig) |
|
|
|
|
|
exist, err := live.GetByActivityId(activity.Id) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
if exist && live.HaveModule(define.MODULE_LOTTERY) { |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawRollStart, |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawRollStart, |
|
|
map[string]interface{}{ |
|
|
map[string]interface{}{ |
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
@ -88,6 +97,7 @@ func (t *LotteryDrawCtl) StartRoll() { |
|
|
"number": num, |
|
|
"number": num, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
t.SUCCESS("操作成功") |
|
|
t.SUCCESS("操作成功") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -112,6 +122,10 @@ func (t *LotteryDrawCtl) StopRoll() { |
|
|
} |
|
|
} |
|
|
// 通知直播开始抽奖
|
|
|
// 通知直播开始抽奖
|
|
|
if activity.RehearsalId == 0 { |
|
|
if activity.RehearsalId == 0 { |
|
|
|
|
|
live := new(models.LiveConfig) |
|
|
|
|
|
exist, err := live.GetByActivityId(activity.Id) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
if exist && live.HaveModule(define.MODULE_LOTTERY) { |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawRollStop, |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawRollStop, |
|
|
map[string]interface{}{ |
|
|
map[string]interface{}{ |
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
@ -121,6 +135,7 @@ func (t *LotteryDrawCtl) StopRoll() { |
|
|
"number": num, |
|
|
"number": num, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
t.SUCCESS("操作成功") |
|
|
t.SUCCESS("操作成功") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -152,6 +167,10 @@ func (t *LotteryDrawCtl) Stop() { |
|
|
|
|
|
|
|
|
// 通知直播开始抽奖
|
|
|
// 通知直播开始抽奖
|
|
|
if activity.RehearsalId == 0 { |
|
|
if activity.RehearsalId == 0 { |
|
|
|
|
|
live := new(models.LiveConfig) |
|
|
|
|
|
exist, err := live.GetByActivityId(activity.Id) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
if exist && live.HaveModule(define.MODULE_LOTTERY) { |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawStop, |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawStop, |
|
|
map[string]interface{}{ |
|
|
map[string]interface{}{ |
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
@ -159,6 +178,7 @@ func (t *LotteryDrawCtl) Stop() { |
|
|
"desc": "结束抽奖", |
|
|
"desc": "结束抽奖", |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
t.SUCCESS("操作成功") |
|
|
t.SUCCESS("操作成功") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -343,7 +363,11 @@ func (t *LotteryDrawCtl) Lottery() { |
|
|
|
|
|
|
|
|
// 通知直播开始抽奖
|
|
|
// 通知直播开始抽奖
|
|
|
if activity.RehearsalId == 0 { |
|
|
if activity.RehearsalId == 0 { |
|
|
im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawResult, |
|
|
|
|
|
|
|
|
live := new(models.LiveConfig) |
|
|
|
|
|
exist, err := live.GetByActivityId(activity.Id) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
if exist && live.HaveModule(define.MODULE_LOTTERY) { |
|
|
|
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawResult, |
|
|
map[string]interface{}{ |
|
|
map[string]interface{}{ |
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
"winners": winners, |
|
|
"winners": winners, |
|
@ -352,6 +376,7 @@ func (t *LotteryDrawCtl) Lottery() { |
|
|
"desc": "抽奖结果", |
|
|
"desc": "抽奖结果", |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
t.JSON(winners) |
|
|
t.JSON(winners) |
|
|
} |
|
|
} |
|
|