|
|
@ -62,20 +62,11 @@ func GetSpecialOrderLottery(repeat string, activityId, ruleId, ladderId, rehears |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
type SpecialOrderWinnersResult 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"` |
|
|
|
EntryPersonName string `json:"entry_person_name"` |
|
|
|
} |
|
|
|
|
|
|
|
func GetSpecialOrderWinnersResult(ruleId, rehearsalId, archId interface{}) (result []*SpecialOrderWinnersResult, err error) { |
|
|
|
func GetSpecialOrderWinnersResult(ruleId, rehearsalId, archId interface{}) (result []*OrderWinnersResult, err error) { |
|
|
|
err = core.GetXormAuto().Table(&models.OrderDrawRecord{}).Alias("r"). |
|
|
|
Select("r.order_entry_person_name as entry_person_name, r.user_id, u.nickname as username, "+ |
|
|
|
" u.phone as user_phone, u.avatar, r.prize_name").Join("LEFT", |
|
|
|
(&models.User{}).Alias("u"), "u.id=r.user_id and u.is_delete=0"). |
|
|
|
Select("r.order_entry_person_name as entry_person_name, r.user_id, o.receiver as username, "+ |
|
|
|
" u.phone as user_phone, r.prize_name").Join("LEFT", |
|
|
|
(&models.CustomerOrder{}).Alias("o"), "o.id=r.customer_order_id and u.is_delete=0"). |
|
|
|
Where("r.is_delete=0 and r.order_draw_rule_id=? and r.rehearsal_id=? and r.arch_id=?", |
|
|
|
ruleId, rehearsalId, archId).Find(&result) |
|
|
|
return |
|
|
|