Commit 7c50164c authored by 张彦钊's avatar 张彦钊

修改志伟ctr统计文件

parent ca65e127
......@@ -23,9 +23,7 @@ def get_data():
cursor = conn2db.cursor()
sql = "select device_id from eagle.ffm_diary_queue where device_id regexp '[5|6]$'"
cursor.execute(sql)
output = DIRECTORY_PATH + "ffm_get_data_" + get_yesterday_date() + ".csv"
result = cursor.fetchall()
pd.DataFrame(list(result)).to_csv("/data2/ffm/abc.csv")
device_id = tuple(pd.DataFrame(list(result))[0].values.tolist())
print(device_id[0:1])
cursor.close()
......@@ -36,7 +34,8 @@ def ctr():
device_id = get_data()
sql_click = "select count(cid) from data_feed_click " \
"where cid_type = 'diary' " \
"and stat_date = '{}' and device_id in '{}')".format(get_yesterday_date(),device_id)
"and stat_date = '{}' and device_id in {})".format(get_yesterday_date(),device_id)
print(sql_click)
db = pymysql.connect(host='10.66.157.22', port=4000, user='root', passwd='3SYz54LS9#^9sBvC', db='jerry_prod')
cursor = db.cursor()
cursor.execute(sql_click)
......@@ -44,7 +43,7 @@ def ctr():
print(click)
sql_exp = "select count(cid) from data_feed_exposure " \
"where cid_type = 'diary' and stat_date = '{}' and " \
"device_id in '{}')".format(get_yesterday_date(),device_id)
"device_id in {})".format(get_yesterday_date(),device_id)
cursor.execute(sql_exp)
exp = cursor.fetchone()
print(exp)
......
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