go-gorm / gorm

The fantastic ORM library for Golang, aims to be developer friendly
https://gorm.io
MIT License
36.76k stars 3.93k forks source link

分组多字段查询数据有重复 #7118

Closed kuangshp closed 2 months ago

kuangshp commented 3 months ago

offset, limit := utils.DbPage(ctx.Request)
var ticketGroup = make([]vo.TicketGroup, 0)
  count, err := tx.Select(dao.TicketEntity.UUID, dao.TicketEntity.Status).
  Group(dao.TicketEntity.UUID, dao.TicketEntity.Status).
  Order(dao.TicketEntity.Status.Desc()).
  ScanByPage(&ticketGroup , offset, limit)

我使用上面的方式查询出数据,第一页出现的数据会出现在第二页中,但是我pageSize=30的时候不会出现, 136dc092b39583b67efe46a883c601b 4d65783adee91e33ce9382d12aa3b76 a642ab80d5ce530678ab8739ba073e0 不知道哪里出了问题,寻求解答

github-actions[bot] commented 3 months ago

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.ioSearch Before Asking