Commit 9ac2ac65 authored by litaolemo's avatar litaolemo

update

parent b4f77d1a
...@@ -277,7 +277,7 @@ baoguang_dict = {} ...@@ -277,7 +277,7 @@ baoguang_dict = {}
# 找出card_id 对应帖子的标签 并分类汇总 得到 标签-计数字段 # 找出card_id 对应帖子的标签 并分类汇总 得到 标签-计数字段
for res in sql_res: for res in sql_res:
# partition_date = res.partition_date # partition_date = res.partition_date
print(res) # print(res)
cl_id = res.cl_id cl_id = res.cl_id
if cl_id in device_id_dict: if cl_id in device_id_dict:
card_id = res.card_id card_id = res.card_id
...@@ -286,10 +286,10 @@ for res in sql_res: ...@@ -286,10 +286,10 @@ for res in sql_res:
if card_id in second_demands_tag_dict: if card_id in second_demands_tag_dict:
for tag_id in second_demands_tag_dict[card_id]: for tag_id in second_demands_tag_dict[card_id]:
if tag_id in second_demands_id_count: if tag_id in second_demands_id_count:
second_demands_id_count[tag_id].append(card_id) second_demands_id_count[tag_id].update(card_id)
else: else:
second_demands_id_count[tag_id] = [] second_demands_id_count[tag_id] = set()
second_demands_id_count[tag_id].append(card_id) second_demands_id_count[tag_id].update(card_id)
if tag_id in baoguang_dict: if tag_id in baoguang_dict:
baoguang_dict[tag_id] += session_pv baoguang_dict[tag_id] += session_pv
...@@ -299,10 +299,10 @@ for res in sql_res: ...@@ -299,10 +299,10 @@ for res in sql_res:
if card_id in projects_demands_tag_dict: if card_id in projects_demands_tag_dict:
for tag_id in projects_demands_tag_dict[card_id]: for tag_id in projects_demands_tag_dict[card_id]:
if tag_id in projects_demands_id_count: if tag_id in projects_demands_id_count:
projects_demands_id_count[tag_id].append(card_id) projects_demands_id_count[tag_id].update(card_id)
else: else:
projects_demands_id_count[tag_id] = [] projects_demands_id_count[tag_id] = set()
projects_demands_id_count[tag_id].append(card_id) projects_demands_id_count[tag_id].update(card_id)
final_projects_list = [] final_projects_list = []
second_demands_list = [] second_demands_list = []
...@@ -311,7 +311,7 @@ for tag_id in second_demands_id_count: ...@@ -311,7 +311,7 @@ for tag_id in second_demands_id_count:
"tag_name": tag_id, "tag_name": tag_id,
"device_count": second_demands_tag_count[tag_id], "device_count": second_demands_tag_count[tag_id],
"tractate_count": second_demands_count_dict.get(tag_id), "tractate_count": second_demands_count_dict.get(tag_id),
"exporsure_count": len(set(second_demands_id_count[tag_id])), "exporsure_count": len(second_demands_id_count[tag_id]),
# "session_pv_count": len(set(second_demands_id_count[tag_id])) # "session_pv_count": len(set(second_demands_id_count[tag_id]))
} }
print(temp_dict) print(temp_dict)
......
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