From 1aec1a2ddae3a3714d6a167d85fcc1c69413b660 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 28 Aug 2014 22:29:00 +0800 Subject: Finish new admin dashboard --- models/org.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'models/org.go') diff --git a/models/org.go b/models/org.go index 1c74c290..18ed68e6 100644 --- a/models/org.go +++ b/models/org.go @@ -159,6 +159,12 @@ func CreateOrganization(org, owner *User) (*User, error) { return org, sess.Commit() } +// CountOrganizations returns number of organizations. +func CountOrganizations() int64 { + count, _ := x.Where("type=1").Count(new(User)) + return count +} + // TODO: need some kind of mechanism to record failure. // DeleteOrganization completely and permanently deletes everything of organization. func DeleteOrganization(org *User) (err error) { -- cgit v1.2.3