Commit d59fb6dd authored by litaolemo's avatar litaolemo

update

parent 48290240
......@@ -317,8 +317,8 @@ def get_count_hot_crawler_data_from_mysql(start_ts: int) -> Dict:
data = cur_mimas.fetchall()
match_all_num = data[0][0]
# print(match_all_num)
oneline_sql = """select count(id) as nums from api_tractate where create_time >= '{time}' and is_online = 1 and platform = {platfrom}""".format(
time=str(start_date), platfrom=platform_id)
oneline_sql = """select count(id) as nums from api_tractate where create_time >= '{time}' and is_online = 1 and pgc_type = 1""".format(
time=str(start_date))
cur_mimas.execute(oneline_sql)
data = cur_mimas.fetchall()
match_oneline_num = data[0][0]
......
......@@ -95,7 +95,7 @@ for res in sql_res:
self_wel_click_pv = res.self_wel_click_pv
partition_day = res.PARTITION_DAY
pid = hashlib.md5((day_id + device_os_type + active_type + grey_type + page_name).encode("utf8")).hexdigest()
sql = """INSERT INTO conent_detail_page_grayscale_ctr(
instert_sql = """INSERT INTO conent_detail_page_grayscale_ctr(
day_id,device_os_type,active_type,grey_type,page_name,content_pv,content_uv,wel_exp_pv,
content_exp_pv,wel_click_pv,content_click_pv,slide_wel_click_pv,self_wel_click_pv,partition_day,pid
) VALUES('{day_id}','{device_os_type}','{active_type}','{grey_type}','{page_name}',{content_pv},{content_uv},
......@@ -105,8 +105,10 @@ for res in sql_res:
content_click_pv=content_click_pv,slide_wel_click_pv=slide_wel_click_pv,self_wel_click_pv=self_wel_click_pv,
partition_day=partition_day, pid=pid
)
print(sql)
res = cursor.execute(sql)
print(instert_sql)
cursor.execute("set names 'UTF8'")
res = cursor.execute(instert_sql)
print(res)
# cursor.executemany()
db.close()
\ No newline at end of file
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