互动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
503 B

5 years ago
  1. package client
  2. import (
  3. "github.com/ouxuanserver/osmanthuswine/src/core"
  4. "hudongzhuanjia/controllers"
  5. "hudongzhuanjia/models"
  6. )
  7. type LotteryCtl struct {
  8. controllers.AuthorCtl
  9. }
  10. func (t *LotteryCtl) UserLotteries() {
  11. uid := t.MustGetUID()
  12. userPrizes := make([]*models.UserPrize, 0)
  13. err := core.GetXormAuto().Where("is_delete=0 and user_id=? ", uid).Desc("created_at").Find(&userPrizes)
  14. t.CheckErr(err)
  15. t.JSON(map[string]interface{}{
  16. "list": userPrizes,
  17. "total": len(userPrizes),
  18. })
  19. }