页码计算适配每页数量为0
This commit is contained in:
@@ -21,6 +21,9 @@ type calculate struct {
|
||||
//
|
||||
// Date : 15:50 2022/7/17
|
||||
func (c *calculate) GetTotalPage(total int64, pageSize int64) int64 {
|
||||
if pageSize <= 0 {
|
||||
return 1
|
||||
}
|
||||
totalPage := total / pageSize
|
||||
if total%pageSize > 0 {
|
||||
totalPage++
|
||||
|
||||
Reference in New Issue
Block a user