Browse Source

fix: 用户数据分析忽略管理员用户

SongZihuan 3 years ago
parent
commit
1f442712bb
1 changed files with 6 additions and 3 deletions
  1. 6 3
      tk_ui/admin_event.py

+ 6 - 3
tk_ui/admin_event.py

@@ -664,7 +664,8 @@ class CountScoreReputationTinyEvent(AdminEventBase):
                                        "count(UserID) AS count"],
                                        "count(UserID) AS count"],
                               table="user",
                               table="user",
                               group_by=["ScoreGB", "ReputationGB"],
                               group_by=["ScoreGB", "ReputationGB"],
-                              order_by=[("ScoreGB", "DESC"), ("ReputationGB", "DESC")])
+                              order_by=[("ScoreGB", "DESC"), ("ReputationGB", "DESC")],
+                              where="IsManager=0")
         if cur is None:
         if cur is None:
             return None
             return None
         lst = np.zeros((100, 100))
         lst = np.zeros((100, 100))
@@ -711,7 +712,8 @@ class CountScoreReputationLargeEvent(AdminEventBase):
                                        "count(UserID) AS count"],
                                        "count(UserID) AS count"],
                               table="user",
                               table="user",
                               group_by=["ScoreGB", "ReputationGB"],
                               group_by=["ScoreGB", "ReputationGB"],
-                              order_by=[("ScoreGB", "DESC"), ("ReputationGB", "DESC")])
+                              order_by=[("ScoreGB", "DESC"), ("ReputationGB", "DESC")],
+                              where="IsManager=0")
         if cur is None:
         if cur is None:
             return None
             return None
         lst = np.zeros((10, 10))
         lst = np.zeros((10, 10))
@@ -755,7 +757,8 @@ class ScoreReputationDistributedEvent(AdminEventBase):
     def func(self, which):
     def func(self, which):
         cur = self._db.search(columns=[which],
         cur = self._db.search(columns=[which],
                               table="user",
                               table="user",
-                              order_by=[(which, "DESC")])
+                              order_by=[(which, "DESC")],
+                              where="IsManager=0")
         if cur is None:
         if cur is None:
             return None
             return None
         return cur.fetchall()
         return cur.fetchall()