parent
50936924cb
commit
9ba51167b8
|
@ -20,7 +20,11 @@ func GetTotalPages(database *gorm.DB, paginationLimit int, any interface{}, wher
|
|||
Count(&totalPages)
|
||||
}
|
||||
|
||||
return int(math.Ceil(float64(totalPages) / float64(paginationLimit)))
|
||||
return CalculateTotalPages(int(totalPages), paginationLimit)
|
||||
}
|
||||
|
||||
func CalculateTotalPages(totalItems int, paginationLimit int) int {
|
||||
return int(math.Ceil(float64(totalItems) / float64(paginationLimit)))
|
||||
}
|
||||
|
||||
func GetPageOffset(page int, paginationLimit int) int {
|
||||
|
|
Loading…
Reference in New Issue