ck 4 years ago
parent
commit
74010e529a
2 changed files with 18 additions and 6 deletions
  1. 10 1
      data_manage/pitcher_panel.py
  2. 8 5
      model/UserAuthUtils.py

+ 10 - 1
data_manage/pitcher_panel.py

@@ -577,7 +577,16 @@ left join src_book_info c on a.dt=c.dt and a.book=c.book  and a.type=c.type and
 def get_channel_summary(user_id,channel,pitcher,page,page_size,order_by,order,state,location,start,end):
 def get_channel_summary(user_id,channel,pitcher,page,page_size,order_by,order,state,location,start,end):
     db=MysqlUtils()
     db=MysqlUtils()
 
 
-    op = f" and a.channel in {str(UserAuthUtils.get_auth_channel(user_id))}" if user_id not in super_auth else ''
+
+
+    if user_id in super_auth:
+        op =''
+    else:
+        if len(UserAuthUtils.get_auth_channel(user_id))==0:
+            return None,None,None
+        else:
+            op = f" and a.channel in {str(UserAuthUtils.get_auth_channel(user_id))}"
+
 
 
     op1=f" and a.channel='{channel}'" if channel else ''
     op1=f" and a.channel='{channel}'" if channel else ''
 
 

+ 8 - 5
model/UserAuthUtils.py

@@ -23,12 +23,15 @@ def get_auth_channel(user_id):
                 left join channel_group b on a.channel_group_id=b.id
                 left join channel_group b on a.channel_group_id=b.id
                 where user_id={user_id}"""
                 where user_id={user_id}"""
 
 
-    data2 = tuple(db.quchen_text.getOne(sql2).split(','))
-    sql3 = f"""select nick_name from t_mp_account where id in {str(data2)}"""
-    data3= db.zx.getOneList(sql3)
-
+    data2 = db.quchen_text.getOne(sql2)
+    if data2:
+        data2_2 = tuple(data2.split(','))
+        sql3 = f"""select nick_name from t_mp_account where id in {str(data2_2)}"""
+        data3= db.zx.getOneList(sql3)
+    else:
+        data3 =[]
     return tuple(data1+data3)
     return tuple(data1+data3)
 
 
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':
-    print(get_auth_channel(78))
+    print(get_auth_channel(118))