|
@ -21,7 +21,16 @@ type OrderDrawCtl struct { |
|
|
|
|
|
|
|
|
// 屏蔽
|
|
|
// 屏蔽
|
|
|
func (t *OrderDrawCtl) Block() { |
|
|
func (t *OrderDrawCtl) Block() { |
|
|
|
|
|
activityId := t.MustGetInt("activity_id") |
|
|
|
|
|
status := t.MustGet("status") |
|
|
|
|
|
|
|
|
|
|
|
module, exist, err := activity_service.GetModuleService(define.MODULE_ORDERLY, activityId) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
t.Assert(exist, code.MSG_MODULE_NOT_EXIST, "模块不存在") |
|
|
|
|
|
module.BesideRepeat = status |
|
|
|
|
|
_, err = models.Update(module.Id, module, "beside_repeat") |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
t.SUCCESS("操作成功") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 开启订单活动
|
|
|
// 开启订单活动
|
|
@ -286,7 +295,8 @@ func (t *OrderDrawCtl) Draw() { |
|
|
t.CheckRunning(ladder.Status) |
|
|
t.CheckRunning(ladder.Status) |
|
|
|
|
|
|
|
|
count, err := core.GetXormAuto().Where("order_draw_rule_id=? and order_draw_rule_ladder_id=? "+ |
|
|
count, err := core.GetXormAuto().Where("order_draw_rule_id=? and order_draw_rule_ladder_id=? "+ |
|
|
"and rehearsal_id=? and is_delete=0", ruleId, ladderId, activity.RehearsalId).Count(new(models.OrderDrawRecord)) |
|
|
|
|
|
|
|
|
"and rehearsal_id=? and arch_id=? and is_delete=0", ruleId, ladderId, activity.RehearsalId, activity.ArchId). |
|
|
|
|
|
Count(new(models.OrderDrawRecord)) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
prizeNum := ladder.PrizeNumber - int(count) |
|
|
prizeNum := ladder.PrizeNumber - int(count) |
|
|
if prizeNum <= 0 || prizeNum < number { |
|
|
if prizeNum <= 0 || prizeNum < number { |
|
@ -296,7 +306,7 @@ func (t *OrderDrawCtl) Draw() { |
|
|
module, exist, err := activity_service.GetModuleService(define.MODULE_ORDERLY, activity.Id) |
|
|
module, exist, err := activity_service.GetModuleService(define.MODULE_ORDERLY, activity.Id) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_MODULE_NOT_EXIST, "模块服务不存在") |
|
|
t.Assert(exist, code.MSG_MODULE_NOT_EXIST, "模块服务不存在") |
|
|
userIds, err := lottery_service.GetOrderLotteryUserIds(module.BesideRepeat, activity.Id, rule.Id, ladder.Id, activity.RehearsalId, area.Id) |
|
|
|
|
|
|
|
|
userIds, err := lottery_service.GetOrderLotteryUserIds(module.BesideRepeat, activity.Id, rule.Id, ladder.Id, activity.RehearsalId, area.Id, activity.ArchId) |
|
|
if len(userIds) < number { |
|
|
if len(userIds) < number { |
|
|
t.ERROR("订单抽奖人数不足", code.MSG_LOTTERY_PEOPLE_NOT_ENOUGH) |
|
|
t.ERROR("订单抽奖人数不足", code.MSG_LOTTERY_PEOPLE_NOT_ENOUGH) |
|
|
} |
|
|
} |
|
|