aboutsummaryrefslogtreecommitdiffstats
path: root/models/org.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/org.go')
-rw-r--r--models/org.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/models/org.go b/models/org.go
index b45dcafb21..5c3b0d12a1 100644
--- a/models/org.go
+++ b/models/org.go
@@ -184,11 +184,10 @@ func CountOrganizations() int64 {
return count
}
-// GetOrganizations returns given number of organizations with offset.
-func GetOrganizations(num, offset int) ([]*User, error) {
- orgs := make([]*User, 0, num)
- err := x.Limit(num, offset).Where("type=1").Asc("id").Find(&orgs)
- return orgs, err
+// Organizations returns number of organizations in given page.
+func Organizations(page, pageSize int) ([]*User, error) {
+ orgs := make([]*User, 0, pageSize)
+ return orgs, x.Limit(pageSize, (page-1)*pageSize).Where("type=1").Asc("id").Find(&orgs)
}
// DeleteOrganization completely and permanently deletes everything of organization.