Commit 13fb2d85 authored by 张彦钊's avatar 张彦钊

统计指标中过滤黑名单

parent 39f42f20
...@@ -18,10 +18,20 @@ def get_data(): ...@@ -18,10 +18,20 @@ def get_data():
sql = "select distinct device_id from ffm_diary_queue_temp where device_id regexp '[5|6]$'" sql = "select distinct device_id from ffm_diary_queue_temp where device_id regexp '[5|6]$'"
cursor.execute(sql) cursor.execute(sql)
result = cursor.fetchall() result = cursor.fetchall()
device = tuple(pd.DataFrame(list(result))[0].values.tolist()) device = pd.DataFrame(list(result))[0].values.tolist()
cursor.close() cursor.close()
print(device[0:2]) conn2db.close()
conn2db = pymysql.connect(host='10.66.157.22', port=4000, user='root', passwd='3SYz54LS9#^9sBvC', db='jerry_prod')
cursor = conn2db.cursor()
sql = "select distinct device_id from blacklist"
cursor.execute(sql)
result = cursor.fetchall()
black = pd.DataFrame(list(result))[0].values.tolist()
cursor.close()
conn2db.close()
device = tuple(set(device)-set(black))
return device return device
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment