diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-09-24 08:14:30 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-09-24 08:14:30 -0400 |
commit | 54c7dba33dc707fa7013a87040c8a8e5d7b237e9 (patch) | |
tree | 6afeaf5fc7f7876f3e7677ed19a83d3e3dce3b44 /store/sql_user_store.go | |
parent | 56f76502e3edcc95f7a0e9c8fe5b3d523b33ee29 (diff) | |
parent | 00112cae5123b02eee79e8b991618ed5069e07b1 (diff) | |
download | chat-54c7dba33dc707fa7013a87040c8a8e5d7b237e9.tar.gz chat-54c7dba33dc707fa7013a87040c8a8e5d7b237e9.tar.bz2 chat-54c7dba33dc707fa7013a87040c8a8e5d7b237e9.zip |
Merge pull request #765 from mattermost/PLT-349
PLT-349 adding team mgt to admin console
Diffstat (limited to 'store/sql_user_store.go')
-rw-r--r-- | store/sql_user_store.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go index 3fd1c82b5..0a723d965 100644 --- a/store/sql_user_store.go +++ b/store/sql_user_store.go @@ -481,3 +481,22 @@ func (us SqlUserStore) GetForExport(teamId string) StoreChannel { return storeChannel } + +func (us SqlUserStore) GetTotalUsersCount() StoreChannel { + storeChannel := make(StoreChannel) + + go func() { + result := StoreResult{} + + if count, err := us.GetReplica().SelectInt("SELECT COUNT(Id) FROM Users"); err != nil { + result.Err = model.NewAppError("SqlUserStore.GetTotalUsersCount", "We could not count the users", err.Error()) + } else { + result.Data = count + } + + storeChannel <- result + close(storeChannel) + }() + + return storeChannel +} |