Commit dcba6d49 authored by 张彦钊's avatar 张彦钊

change test

parent 973bd9be
......@@ -7,7 +7,6 @@ def con_sql(db,sql):
cursor = db.cursor()
cursor.execute(sql)
result = cursor.fetchone()[0]
print(result)
db.close()
return result
......@@ -18,11 +17,12 @@ def get_ctr():
print(yesterday)
sql = "select count(*) from data_feed_exposure_precise where stat_date = '{}' and cid_type = 'diary'".format(yesterday)
exposures = con_sql(db, sql)
# sql = "select count(*) from data_feed_click where stat_date = '{}' and cid_type = 'diary'".format(yesterday)
# clicks = con_sql(db, sql)
# print(exposures)
# print(clicks)
# print(clicks/exposures)
sql = "select count(*) from data_feed_click where stat_date = '{}' and cid_type = 'diary'".format(yesterday)
clicks = con_sql(db, sql)
db.close()
print(exposures)
print(clicks)
print(clicks/exposures)
......
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