|
|
@@ -29,13 +29,13 @@ func PageSearch(engine *xorm.Engine, controllername string, apiname string, tabl
|
|
|
}
|
|
|
records := cresult[0]["records"].(int64)
|
|
|
|
|
|
- var totalSize int64 = 0
|
|
|
- if totalSize < int64(rows) {
|
|
|
- totalSize = 1
|
|
|
+ var totalPageSize int64 = 0
|
|
|
+ if totalPageSize < int64(rows) {
|
|
|
+ totalPageSize = 1
|
|
|
} else if records%int64(rows) == 0 {
|
|
|
- totalSize = records / int64(rows)
|
|
|
+ totalPageSize = records / int64(rows)
|
|
|
} else {
|
|
|
- totalSize = records / int64(rows+1)
|
|
|
+ totalPageSize = records / int64(rows+1)
|
|
|
}
|
|
|
|
|
|
presult := models.PageResult{}
|
|
|
@@ -43,6 +43,6 @@ func PageSearch(engine *xorm.Engine, controllername string, apiname string, tabl
|
|
|
presult.Rows = (rows)
|
|
|
presult.Content = result
|
|
|
presult.TotalSize = records
|
|
|
-
|
|
|
+ presult.TotalPageSize = totalPageSize
|
|
|
return &presult, nil
|
|
|
}
|