Compare commits

...

2 Commits

Author SHA1 Message Date
445c6407db update go mod 2023-10-14 22:28:40 +08:00
a61f85b4e7 页码计算适配每页数量为0 2023-10-14 22:27:50 +08:00
2 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,9 @@ type calculate struct {
// //
// Date : 15:50 2022/7/17 // Date : 15:50 2022/7/17
func (c *calculate) GetTotalPage(total int64, pageSize int64) int64 { func (c *calculate) GetTotalPage(total int64, pageSize int64) int64 {
if pageSize <= 0 {
return 1
}
totalPage := total / pageSize totalPage := total / pageSize
if total%pageSize > 0 { if total%pageSize > 0 {
totalPage++ totalPage++

2
go.mod
View File

@ -1,6 +1,6 @@
module git.zhangdeman.cn/zhangdeman/util module git.zhangdeman.cn/zhangdeman/util
go 1.20 go 1.21
require ( require (
github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir v1.1.0