|
@ -25,7 +25,7 @@ func (t *LotteryDrawCtl) Start() { |
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
|
|
|
|
|
|
ladder := new(models.LotteryDrawRuleLadder) |
|
|
ladder := new(models.LotteryDrawRuleLadder) |
|
|
exist, err := models.GetById(ladder, ladderId) |
|
|
|
|
|
|
|
|
exist, err := models.Get(ladder, ladderId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_LOTTERY_RULE_NOT_EXIST, "抽奖规则不存在") |
|
|
t.Assert(exist, code.MSG_LOTTERY_RULE_NOT_EXIST, "抽奖规则不存在") |
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ func (t *LotteryDrawCtl) StartRoll() { |
|
|
num := t.MustGetInt64("num") |
|
|
num := t.MustGetInt64("num") |
|
|
|
|
|
|
|
|
ladder := new(models.LotteryDrawRuleLadder) |
|
|
ladder := new(models.LotteryDrawRuleLadder) |
|
|
exist, err := models.GetById(ladder, ladderId) |
|
|
|
|
|
|
|
|
exist, err := models.Get(ladder, ladderId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_LOTTERY_RULE_NOT_EXIST, "抽奖规则不存在") |
|
|
t.Assert(exist, code.MSG_LOTTERY_RULE_NOT_EXIST, "抽奖规则不存在") |
|
|
|
|
|
|
|
@ -79,7 +79,7 @@ func (t *LotteryDrawCtl) StopRoll() { |
|
|
num := t.MustGetInt64("num") |
|
|
num := t.MustGetInt64("num") |
|
|
|
|
|
|
|
|
ladder := new(models.LotteryDrawRuleLadder) |
|
|
ladder := new(models.LotteryDrawRuleLadder) |
|
|
exist, err := models.GetById(ladder, ladderId) |
|
|
|
|
|
|
|
|
exist, err := models.Get(ladder, ladderId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_LOTTERY_RULE_NOT_EXIST, "抽奖规则不存在") |
|
|
t.Assert(exist, code.MSG_LOTTERY_RULE_NOT_EXIST, "抽奖规则不存在") |
|
|
|
|
|
|
|
@ -103,7 +103,7 @@ func (t *LotteryDrawCtl) Stop() { |
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
|
|
|
|
|
|
ladder := new(models.LotteryDrawRuleLadder) |
|
|
ladder := new(models.LotteryDrawRuleLadder) |
|
|
exist, err := models.GetById(ladder, ladderId) |
|
|
|
|
|
|
|
|
exist, err := models.Get(ladder, ladderId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_LOTTERY_RULE_NOT_EXIST, "抽奖规则不存在") |
|
|
t.Assert(exist, code.MSG_LOTTERY_RULE_NOT_EXIST, "抽奖规则不存在") |
|
|
|
|
|
|
|
@ -151,12 +151,12 @@ func (t *LotteryDrawCtl) List() { |
|
|
customerId := t.MustGetUID() |
|
|
customerId := t.MustGetUID() |
|
|
|
|
|
|
|
|
customer := new(models.Customer) |
|
|
customer := new(models.Customer) |
|
|
exist, err := models.GetById(customer, customerId) |
|
|
|
|
|
|
|
|
exist, err := models.Get(customer, customerId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") |
|
|
t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") |
|
|
|
|
|
|
|
|
activity := new(models.Activity) |
|
|
activity := new(models.Activity) |
|
|
exist, err = models.GetById(activity, activityId) |
|
|
|
|
|
|
|
|
exist, err = models.Get(activity, activityId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在") |
|
|
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在") |
|
|
|
|
|
|
|
@ -254,12 +254,12 @@ func (t *LotteryDrawCtl) Users() { |
|
|
customerId := t.MustGetUID() |
|
|
customerId := t.MustGetUID() |
|
|
|
|
|
|
|
|
customer := new(models.Customer) |
|
|
customer := new(models.Customer) |
|
|
exist, err := models.GetById(customer, customerId) |
|
|
|
|
|
|
|
|
exist, err := models.Get(customer, customerId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") |
|
|
t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") |
|
|
|
|
|
|
|
|
activity := new(models.Activity) |
|
|
activity := new(models.Activity) |
|
|
exist, err = models.GetById(activity, activityId) |
|
|
|
|
|
|
|
|
exist, err = models.Get(activity, activityId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在") |
|
|
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在") |
|
|
|
|
|
|
|
@ -309,12 +309,12 @@ func (t *LotteryDrawCtl) Lottery() { |
|
|
customerId := t.MustGetUID() |
|
|
customerId := t.MustGetUID() |
|
|
|
|
|
|
|
|
customer := new(models.Customer) |
|
|
customer := new(models.Customer) |
|
|
exist, err := models.GetById(customer, customerId) |
|
|
|
|
|
|
|
|
exist, err := models.Get(customer, customerId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") |
|
|
t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") |
|
|
|
|
|
|
|
|
activity := new(models.Activity) |
|
|
activity := new(models.Activity) |
|
|
exist, err = models.GetById(activity, activityId) |
|
|
|
|
|
|
|
|
exist, err = models.Get(activity, activityId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在") |
|
|
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在") |
|
|
t.CheckRunning(activity.Status) |
|
|
t.CheckRunning(activity.Status) |
|
@ -330,13 +330,13 @@ func (t *LotteryDrawCtl) Lottery() { |
|
|
t.Assert(exist, code.MSG_DATA_NOT_EXIST, "地区不存在") |
|
|
t.Assert(exist, code.MSG_DATA_NOT_EXIST, "地区不存在") |
|
|
|
|
|
|
|
|
rule := new(models.LotteryDrawRule) |
|
|
rule := new(models.LotteryDrawRule) |
|
|
exist, err = models.GetById(rule, ruleId) |
|
|
|
|
|
|
|
|
exist, err = models.Get(rule, ruleId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_DATA_NOT_EXIST, "抽奖规则不存在") |
|
|
t.Assert(exist, code.MSG_DATA_NOT_EXIST, "抽奖规则不存在") |
|
|
|
|
|
|
|
|
// 查询奖品
|
|
|
// 查询奖品
|
|
|
ladder := new(models.LotteryDrawRuleLadder) |
|
|
ladder := new(models.LotteryDrawRuleLadder) |
|
|
exist, err = models.GetById(ladder, ladderId) |
|
|
|
|
|
|
|
|
exist, err = models.Get(ladder, ladderId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_DATA_NOT_EXIST, "抽奖等级不存在") |
|
|
t.Assert(exist, code.MSG_DATA_NOT_EXIST, "抽奖等级不存在") |
|
|
t.CheckRunning(ladder.Status) |
|
|
t.CheckRunning(ladder.Status) |
|
|