|
@ -92,12 +92,13 @@ type UserAuctionsResult struct { |
|
|
Unit int64 `json:"unit"` |
|
|
Unit int64 `json:"unit"` |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func GetUserAuctions(activityId, userId int64) ([]*UserAuctionsResult, error) { |
|
|
|
|
|
|
|
|
func GetUserAuctions(activityId, rehearsalId, userId int64) ([]*UserAuctionsResult, error) { |
|
|
records := make([]*UserAuctionsResult, 0) |
|
|
records := make([]*UserAuctionsResult, 0) |
|
|
err := core.GetXormAuto().Table(new(models.AuctionResultRecord)).Alias("r"). |
|
|
err := core.GetXormAuto().Table(new(models.AuctionResultRecord)).Alias("r"). |
|
|
Select("r.id, a.id as auction_activity_id, a.auction_goods_name, a.goods_pic_url, r.deal_price, a.unit"). |
|
|
Select("r.id, a.id as auction_activity_id, a.auction_goods_name, a.goods_pic_url, r.deal_price, a.unit"). |
|
|
Join("LEFT", new(models.NewAuctionActivity).Alias("a"), "a.id=r.auction_activity_id and a.is_delete=0"). |
|
|
|
|
|
Where("r.is_delete=0 and r.activity_id=? and r.user_id=?", activityId, userId). |
|
|
|
|
|
Desc("r.created_at").Find(&records) |
|
|
|
|
|
|
|
|
Join("LEFT", new(models.NewAuctionActivity).Alias("a"), |
|
|
|
|
|
"a.id=r.auction_activity_id and a.is_delete=0"). |
|
|
|
|
|
Where("r.is_delete=0 and r.activity_id=? and r.user_id=? and r.rehearsal_id=?", |
|
|
|
|
|
activityId, userId, rehearsalId).Desc("r.created_at").Find(&records) |
|
|
return records, err |
|
|
return records, err |
|
|
} |
|
|
} |