This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
Repositories
Datasets
Forum
实训
竞赛
大数据
应用
Register
Sign In
OpenI
/
aiforge
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
128
Wiki
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
Browse Source
Merge pull request
#561
from eryx/master
Fix pagination() to get the right total number of pages
tags/v1.2.0-rc1
无闻
10 years ago
parent
4a8a70dde0
fb8beaf19a
commit
1a38f0e0d9
1 changed files
with
2 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+2
-1
routers/admin/users.go
+ 2
- 1
routers/admin/users.go
View File
@@ -5,6 +5,7 @@
package admin
import (
"math"
"strings"
"github.com/Unknwon/com"
@@ -30,7 +31,7 @@ func pagination(ctx *middleware.Context, count int64, pageNum int) int {
}
curCount := int64((p-1)*pageNum + pageNum)
if curCount >= count {
p = int(count) / pageNum
p = int(
math.Ceil(float64(
count) /
float64(
pageNum
)))
} else {
ctx.Data["NextPageNum"] = p + 1
}
Write
Preview
Loading…
Cancel
Save