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: ...@@ -317,8 +317,8 @@ def get_count_hot_crawler_data_from_mysql(start_ts: int) -> Dict:
data = cur_mimas.fetchall() data = cur_mimas.fetchall()
match_all_num = data[0][0] match_all_num = data[0][0]
# print(match_all_num) # 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( 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), platfrom=platform_id) time=str(start_date))
cur_mimas.execute(oneline_sql) cur_mimas.execute(oneline_sql)
data = cur_mimas.fetchall() data = cur_mimas.fetchall()
match_oneline_num = data[0][0] match_oneline_num = data[0][0]
......
...@@ -95,7 +95,7 @@ for res in sql_res: ...@@ -95,7 +95,7 @@ for res in sql_res:
self_wel_click_pv = res.self_wel_click_pv self_wel_click_pv = res.self_wel_click_pv
partition_day = res.PARTITION_DAY partition_day = res.PARTITION_DAY
pid = hashlib.md5((day_id + device_os_type + active_type + grey_type + page_name).encode("utf8")).hexdigest() 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, 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 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}, ) 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: ...@@ -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, 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 partition_day=partition_day, pid=pid
) )
print(sql) print(instert_sql)
res = cursor.execute(sql) cursor.execute("set names 'UTF8'")
res = cursor.execute(instert_sql)
print(res) print(res)
# cursor.executemany() # cursor.executemany()
db.close() 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