|
|
@ -64,20 +64,20 @@ func GetLotteryUserIds(repeat string, activityId, ruleId, ladderId, rehearsalId, |
|
|
|
} |
|
|
|
|
|
|
|
type LotteryListResult struct { |
|
|
|
LotteryDrawActivityId int `json:"lottery_draw_activity_id"` |
|
|
|
LotteryDrawRuleId int `json:"lottery_draw_rule_id"` |
|
|
|
LotteryDrawActivityId int `json:"lottery_draw_activity_id"` |
|
|
|
LotteryDrawRuleId int `json:"lottery_draw_rule_id"` |
|
|
|
LotteryDrawActivityName string `json:"lottery_draw_name"` |
|
|
|
LotteryDrawLadders []*LotteryLadderResult `json:"lottery_draw_ladders"` |
|
|
|
PrizeNumber int `json:"prize_number"` |
|
|
|
PrizeNumber int `json:"prize_number"` |
|
|
|
} |
|
|
|
|
|
|
|
type LotteryLadderResult struct { |
|
|
|
LotteryDrawRuleId int `json:"-"` |
|
|
|
LotteryDrawLadderId int `json:"lottery_draw_ladder_id"` |
|
|
|
LotteryDrawRuleId int `json:"-"` |
|
|
|
LotteryDrawLadderId int `json:"lottery_draw_ladder_id"` |
|
|
|
Status string `json:"status"` |
|
|
|
PrizeName string `json:"prize_name"` |
|
|
|
PrizeImg string `json:"prize_img"` |
|
|
|
PrizeNumber int `json:"prize_number"` |
|
|
|
PrizeNumber int `json:"prize_number"` |
|
|
|
} |
|
|
|
|
|
|
|
func GetLotteryAndLadder(activityId, rehearsalId, archId interface{}) ([]*LotteryListResult, error) { |
|
|
@ -139,7 +139,7 @@ func GetLotteryAndLadder(activityId, rehearsalId, archId interface{}) ([]*Lotter |
|
|
|
} |
|
|
|
|
|
|
|
type LotteryUsersResult struct { |
|
|
|
UserId int `json:"user_id"` |
|
|
|
UserId int `json:"user_id"` |
|
|
|
Username string `json:"username"` |
|
|
|
Avatar string `json:"avatar"` |
|
|
|
} |
|
|
@ -176,16 +176,17 @@ func GetLotteryUsersResult(areaId, activityId, rehearsalId, archId interface{}, |
|
|
|
} |
|
|
|
|
|
|
|
type WinnersResult struct { |
|
|
|
UserId int `json:"user_id"` |
|
|
|
UserName string `json:"user_name"` |
|
|
|
UserPhone string `json:"user_phone"` |
|
|
|
Avatar string `json:"avatar"` |
|
|
|
PrizeName string `json:"prize_name"` |
|
|
|
UserId int `json:"user_id"` |
|
|
|
UserName string `json:"user_name"` |
|
|
|
UserPhone string `json:"user_phone"` |
|
|
|
Avatar string `json:"avatar"` |
|
|
|
PrizeName string `json:"prize_name"` |
|
|
|
EntryPersonName string `json:"entry_person_name"` |
|
|
|
} |
|
|
|
|
|
|
|
func GetWinnersResult(ruleId, rehearsalId, archId interface{}) ([]*WinnersResult, error) { |
|
|
|
result := make([]*WinnersResult, 0) |
|
|
|
err := core.GetXormAuto().Table(new(models.LotteryDrawRecord)).Alias("r"). |
|
|
|
err := core.GetXormAuto().Table(&models.LotteryDrawRecord{}).Alias("r"). |
|
|
|
Join("LEFT", new(models.User).Alias("u"), "u.id=r.user_id"). |
|
|
|
Where("r.is_delete=0 and r.lottery_draw_rule_id=? and r.rehearsal_id=? and r.arch_id=?", |
|
|
|
ruleId, rehearsalId, archId).Find(&result) |
|
|
|