ソースを参照

add countListByStatus

Seiya Tashiro 7 年 前
コミット
3269d19f8b
1 ファイル変更7 行追加0 行削除
  1. 7 0
      src/server/models/user.js

+ 7 - 0
src/server/models/user.js

@@ -518,6 +518,13 @@ module.exports = function(crowi) {
     return isUserCountExceedsUpperLimit;
   };
 
+  userSchema.statics.countListByStatus = async function(status) {
+    const User = this;
+    const conditions = {status: status};
+
+    return User.find(conditions).count();
+  };
+
   userSchema.statics.isRegisterableUsername = async function(username) {
     var User = this;
     var usernameUsable = true;