diff options
author | Unknwon <u@gogs.io> | 2015-09-11 20:42:26 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-11 20:42:26 -0400 |
commit | be89802bd8131835ed894280e75bba9f769cf575 (patch) | |
tree | e61abeedbe2079ab00f399c3b9a5501bcebc656c /models | |
parent | 247017d9ff9b9947349555cdfd566cad061564ea (diff) | |
download | gitea-be89802bd8131835ed894280e75bba9f769cf575.tar.gz gitea-be89802bd8131835ed894280e75bba9f769cf575.zip |
new admin user list UI
Diffstat (limited to 'models')
-rw-r--r-- | models/user.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/models/user.go b/models/user.go index b49e96d3ce..5dbe6ffd21 100644 --- a/models/user.go +++ b/models/user.go @@ -432,11 +432,10 @@ func CountUsers() int64 { return countUsers(x) } -// GetUsers returns given number of user objects with offset. -func GetUsers(num, offset int) ([]*User, error) { - users := make([]*User, 0, num) - err := x.Limit(num, offset).Where("type=0").Asc("id").Find(&users) - return users, err +// Users returns number of users in given page. +func Users(page, pageSize int) ([]*User, error) { + users := make([]*User, 0, pageSize) + return users, x.Limit(pageSize, (page-1)*pageSize).Where("type=0").Asc("id").Find(&users) } // get user by erify code |