Merge branch 'develop'
admin [init ok] lea++ blog platform [ok]
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package info
|
||||
|
||||
import (
|
||||
"math"
|
||||
)
|
||||
|
||||
|
||||
@ -10,4 +11,12 @@ type Page struct {
|
||||
TotalPage int // 总页
|
||||
Count int // 总记录数
|
||||
List interface{}
|
||||
}
|
||||
|
||||
func NewPage(page, perPageSize, count int, list interface{}) Page {
|
||||
totalPage := 0
|
||||
if count > 0 {
|
||||
totalPage = int(math.Ceil(float64(count) / float64(perPageSize)))
|
||||
}
|
||||
return Page{page, totalPage, count, list}
|
||||
}
|
Reference in New Issue
Block a user