summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index b98e81babe..47f1d45f0e 100644
--- a/models/user.go
+++ b/models/user.go
@@ -212,6 +212,12 @@ func CreateUser(u *User) (*User, error) {
return u, err
}
+// CountUsers returns number of users.
+func CountUsers() int64 {
+ count, _ := x.Where("type=0").Count(new(User))
+ return count
+}
+
// GetUsers returns given number of user objects with offset.
func GetUsers(num, offset int) ([]User, error) {
users := make([]User, 0, num)