ck 4 年 前
コミット
b8cda2c2e3
2 ファイル変更8 行追加2 行削除
  1. 4 2
      data_manage/pitcher_panel.py
  2. 4 0
      model/UserAuthUtils.py

+ 4 - 2
data_manage/pitcher_panel.py

@@ -600,10 +600,12 @@ def get_channel_summary(user_id,channel,pitcher,page,page_size,order_by,order,st
     if user_id in super_auth():  # 超级数据权限
         op = ''
     else:
+        user_name = UserAuthUtils.get_user_name_by_id(user_id)
+        auth_user_li = UserAuthUtils.get_auth_user(user_id)
         if len(UserAuthUtils.get_auth_user(user_id)) == 0: # 属于普通用户
-            op = f" and pitcher='{user_id}'"
+            op = f" and pitcher='{user_name}'"
         else:
-            op = f" and pitcher in {tuple(UserAuthUtils.get_auth_user(user_id)+[user_id])}"
+            op = f" and pitcher in {tuple(auth_user_li+[user_name])}"
 
     op1=f" and a.channel='{channel}'" if channel else ''
     op2=f" and pitcher='{pitcher}'" if pitcher else ''

+ 4 - 0
model/UserAuthUtils.py

@@ -53,6 +53,10 @@ def get_role(user_id):
     sql = "select role_id from t_sys_user_role where user_id ="+str(user_id)
     return db.zx.getOneList(sql)
 
+def get_user_name_by_id(user_id):
+    db = MysqlUtils()
+    sql = "select nick_name from t_sys_user where user_id =" + str(user_id)
+    return db.zx.getOne(sql)
 
 if __name__ == '__main__':
     # print(get_auth_channel(109))