|
|
@ -4,6 +4,7 @@ import ( |
|
|
|
"github.com/ouxuanserver/osmanthuswine/src/core" |
|
|
|
"hudongzhuanjia/controllers" |
|
|
|
"hudongzhuanjia/models" |
|
|
|
"hudongzhuanjia/utils/code" |
|
|
|
) |
|
|
|
|
|
|
|
type LotteryCtl struct { |
|
|
@ -43,3 +44,14 @@ func (t *LotteryCtl) CashLottery() { |
|
|
|
t.CheckErr(err) |
|
|
|
t.SUCCESS("兑奖成功") |
|
|
|
} |
|
|
|
|
|
|
|
func (t *LotteryCtl) CheckLottery() { |
|
|
|
uid := t.MustGetUID() |
|
|
|
ladderId := t.MustGetInt64("lottery_draw_ladder_id") |
|
|
|
|
|
|
|
record := new(models.LotteryDrawRecord) |
|
|
|
exist, err := record.GetByUserIdAndLadderId(uid, ladderId) |
|
|
|
t.CheckErr(err) |
|
|
|
t.Assert(exist, code.MSG_LOTTERY_DRAW_NOT_HIT, "没有中奖") |
|
|
|
t.JSON(record) |
|
|
|
} |