feat: 更新导出cdr分页逻辑,1页最大条数为条件的总条数

This commit is contained in:
TsMask
2025-08-27 10:25:25 +08:00
parent 888b1095f7
commit 1429d35167
5 changed files with 16 additions and 12 deletions

View File

@@ -254,11 +254,11 @@ func (r CDREventIMS) SelectByPage(querys model.CDREventIMSQuery) ([]model.CDREve
tx = tx.Order(sortField)
}
if querys.PageSize == 0 {
querys.PageSize = total
}
// 查询数据分页
pageNum, pageSize := datasource.PageNumSize(querys.PageNum, querys.PageSize)
if pageNum == 0 && pageSize > int(total) {
pageSize = int(total)
}
tx = tx.Limit(pageSize).Offset(pageSize * pageNum)
err := tx.Find(&rows).Error
if err != nil {

View File

@@ -63,11 +63,11 @@ func (r CDREventSGWC) SelectByPage(querys model.CDREventSGWCQuery) ([]model.CDRE
tx = tx.Order(sortField)
}
if querys.PageSize == 0 {
querys.PageSize = total
}
// 查询数据分页
pageNum, pageSize := datasource.PageNumSize(querys.PageNum, querys.PageSize)
if pageNum == 0 && pageSize > int(total) {
pageSize = int(total)
}
tx = tx.Limit(pageSize).Offset(pageSize * pageNum)
err := tx.Find(&rows).Error
if err != nil {

View File

@@ -235,11 +235,11 @@ func (r CDREventSMF) SelectByPage(querys model.CDREventSMFQuery) ([]model.CDREve
tx = tx.Order(sortField)
}
if querys.PageSize == 0 {
querys.PageSize = total
}
// 查询数据分页
pageNum, pageSize := datasource.PageNumSize(querys.PageNum, querys.PageSize)
if pageNum == 0 && pageSize > int(total) {
pageSize = int(total)
}
tx = tx.Limit(pageSize).Offset(pageSize * pageNum)
err := tx.Find(&rows).Error
if err != nil {

View File

@@ -255,11 +255,11 @@ func (r CDREventSMSC) SelectByPage(querys model.CDREventSMSCQuery) ([]model.CDRE
tx = tx.Order(sortField)
}
if querys.PageSize == 0 {
querys.PageSize = total
}
// 查询数据分页
pageNum, pageSize := datasource.PageNumSize(querys.PageNum, querys.PageSize)
if pageNum == 0 && pageSize > int(total) {
pageSize = int(total)
}
tx = tx.Limit(pageSize).Offset(pageSize * pageNum)
err := tx.Find(&rows).Error
if err != nil {