Explorar o código

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

SongZihuan %!s(int64=3) %!d(string=hai) anos
pai
achega
1f442712bb
Modificáronse 1 ficheiros con 6 adicións e 3 borrados
  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"],
                               table="user",
                               group_by=["ScoreGB", "ReputationGB"],
-                              order_by=[("ScoreGB", "DESC"), ("ReputationGB", "DESC")])
+                              order_by=[("ScoreGB", "DESC"), ("ReputationGB", "DESC")],
+                              where="IsManager=0")
         if cur is None:
             return None
         lst = np.zeros((100, 100))
@@ -711,7 +712,8 @@ class CountScoreReputationLargeEvent(AdminEventBase):
                                        "count(UserID) AS count"],
                               table="user",
                               group_by=["ScoreGB", "ReputationGB"],
-                              order_by=[("ScoreGB", "DESC"), ("ReputationGB", "DESC")])
+                              order_by=[("ScoreGB", "DESC"), ("ReputationGB", "DESC")],
+                              where="IsManager=0")
         if cur is None:
             return None
         lst = np.zeros((10, 10))
@@ -755,7 +757,8 @@ class ScoreReputationDistributedEvent(AdminEventBase):
     def func(self, which):
         cur = self._db.search(columns=[which],
                               table="user",
-                              order_by=[(which, "DESC")])
+                              order_by=[(which, "DESC")],
+                              where="IsManager=0")
         if cur is None:
             return None
         return cur.fetchall()