fix: 分页

This commit is contained in:
wangxinyu 2024-12-09 15:01:37 +08:00
parent 468b1cbea9
commit 7ef275a85e
2 changed files with 4 additions and 4 deletions

View File

@ -291,7 +291,7 @@ func (m *Mongo) AddWithdrawHis(ctx *gin.Context, doc *dbstruct.WithdrawHis) erro
}
// 用户退款表:查询主播审核列表
func (m *Mongo) GetZoneRefundList(ctx *gin.Context, bMid int64, refundsStatusList []int64) ([]*dbstruct.RefundInfo, error) {
func (m *Mongo) GetZoneRefundList(ctx *gin.Context, bMid int64, refundsStatusList []int64, offset int, limit int) ([]*dbstruct.RefundInfo, error) {
list := make([]*dbstruct.RefundInfo, 0)
doc := m.GetZoneRefund()
@ -301,7 +301,7 @@ func (m *Mongo) GetZoneRefundList(ctx *gin.Context, bMid int64, refundsStatusLis
"$in": refundsStatusList,
},
}
err := doc.Find(ctx, query).All(&list)
err := doc.Find(ctx, query).Limit(int64(limit)).Skip(int64(offset)).All(&list)
if errors.Is(err, qmgo.ErrNoSuchDocuments) {
err = nil
return nil, err

View File

@ -1099,9 +1099,9 @@ func (v *Vas) ZoneRefundList(ctx *gin.Context, req *vasproto.ZoneRefundListReq)
if req.AuditType == consts.UnAudited {
refundsStatusList = append(refundsStatusList, dbstruct.RefundsAwaiting)
} else if req.AuditType == consts.Audited {
refundsStatusList = append(refundsStatusList, dbstruct.RefundsApproved, dbstruct.RefundsRejected, dbstruct.RefundsOvertime)
refundsStatusList = append(refundsStatusList, dbstruct.RefundsApproved, dbstruct.RefundsAutomatic, dbstruct.RefundsRejected, dbstruct.RefundsOvertime)
}
list, err = v.store.GetZoneRefundList(ctx, req.Mid, refundsStatusList)
list, err = v.store.GetZoneRefundList(ctx, req.Mid, refundsStatusList, req.Offset, req.Limit)
if err != nil {
logger.Error("ZoneRefundList GetZoneRefundList fail, mid: %v, audit_type: %v, err: %v", req.Mid, req.AuditType, err)
return