Commit ea553dcb authored by litaolemo's avatar litaolemo

update

parent 997b7963
......@@ -337,16 +337,14 @@ def get_es_article_num(tag_dict,
return article_dict
def get_user_post_from_mysql():
data_tag_count = {}
def get_user_post_from_mysql(sql):
card_id_list = []
second_demands_count_dict = {}
tags_v3_count_dict = {}
sql = """
select card_id from strategy_content_exposure_index where card_content_type="user_post" and preciseexposure_num>=30 and ctr>=0.04 and avg_page_stay>=15 and create_day="2020-09-17";
"""
sql_res = con_sql_doris_prod(sql)
for card_id in sql_res:
# print(card_id)
card_id_list.append(card_id)
es_res = get_tractate_tags_from_es(card_id[0])
for position in es_res["_source"]["second_demands"]:
if position in second_demands_count_dict:
......@@ -358,4 +356,4 @@ select card_id from strategy_content_exposure_index where card_content_type="use
tags_v3_count_dict[tag] += 1
else:
tags_v3_count_dict[tag] = 1
return second_demands_count_dict, tags_v3_count_dict
return second_demands_count_dict, tags_v3_count_dict, card_id_list
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