package client import ( "github.com/ouxuanserver/osmanthuswine/src/core" "hudongzhuanjia/controllers" "hudongzhuanjia/models" ) type LotteryCtl struct { controllers.AuthorCtl } func (t *LotteryCtl) UserLotteries() { uid := t.MustGetUID() userPrizes := make([]*models.UserPrize, 0) err := core.GetXormAuto().Where("is_delete=0 and user_id=? ", uid).Desc("created_at").Find(&userPrizes) t.CheckErr(err) t.JSON(map[string]interface{}{ "list": userPrizes, "total": len(userPrizes), }) }