Commit c0b5f226 authored by litaolemo's avatar litaolemo

update

parent 93284bd3
...@@ -287,28 +287,28 @@ for res in sql_res: ...@@ -287,28 +287,28 @@ for res in sql_res:
card_id_set.update(card_id) card_id_set.update(card_id)
if cl_id in second_demands_tag_dict: if cl_id in second_demands_tag_dict:
for tag_id in second_demands_tag_dict[cl_id]: for tag_id in second_demands_tag_dict[cl_id]:
if cl_id in second_demands_id_count: if tag_id in second_demands_id_count:
second_demands_id_count[tag_id].update(card_id) second_demands_id_count[tag_id][card_id] = 1
else: else:
second_demands_id_count[tag_id] = set() second_demands_id_count[tag_id] = {}
second_demands_id_count[tag_id].update(card_id) second_demands_id_count[tag_id][card_id] = 1
if tag_id in baoguang_dict: # if tag_id in baoguang_dict:
baoguang_dict[tag_id] += session_pv # baoguang_dict[tag_id] += session_pv
else: # else:
baoguang_dict[tag_id] = session_pv # baoguang_dict[tag_id] = session_pv
if cl_id in projects_demands_tag_dict: if cl_id in projects_demands_tag_dict:
for tag_id in projects_demands_tag_dict[cl_id]: for tag_id in projects_demands_tag_dict[cl_id]:
if tag_id in projects_demands_id_count: if tag_id in projects_demands_id_count:
projects_demands_id_count[tag_id].update(card_id) projects_demands_id_count[tag_id][card_id] = 1
else: else:
projects_demands_id_count[tag_id] = set() projects_demands_id_count[tag_id] = {}
projects_demands_id_count[tag_id].update(card_id) projects_demands_id_count[tag_id][card_id] = 1
final_projects_list = [] final_projects_list = []
second_demands_list = [] second_demands_list = []
for tag_id in second_demands_id_count: for tag_id in second_demands_tag_count:
temp_dict = { temp_dict = {
"tag_name": tag_id, "tag_name": tag_id,
"device_count": second_demands_tag_count[tag_id], "device_count": second_demands_tag_count[tag_id],
...@@ -319,12 +319,12 @@ for tag_id in second_demands_id_count: ...@@ -319,12 +319,12 @@ for tag_id in second_demands_id_count:
print(temp_dict) print(temp_dict)
print("----------------------------------------------") print("----------------------------------------------")
for tag_id in projects_demands_id_count: for tag_id in projects_demands_tag_count:
temp_dict = { temp_dict = {
"tag_name": tag_id, "tag_name": tag_id,
"device_count": projects_demands_tag_count[tag_id], "device_count": projects_demands_tag_count[tag_id],
"tractate_count": tags_v3_count_dict.get(tag_id), "tractate_count": tags_v3_count_dict.get(tag_id),
"exporsure_count": len(set(projects_demands_id_count[tag_id])), "exporsure_count": len(projects_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)
\ 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