Commit a0fa13b1 by dong

fix20230109

parent 23fd0b8b
...@@ -217,7 +217,6 @@ def find_up_thr1(industry_type, industry_id): ...@@ -217,7 +217,6 @@ def find_up_thr1(industry_type, industry_id):
for pname_one in res_one: # 一级节点 for pname_one in res_one: # 一级节点
chain_name1 = pname_one["chain_name"] chain_name1 = pname_one["chain_name"]
total_count = 0 total_count = 0
node_one = ''
# 一级的企业数量 # 一级的企业数量
company_count = get_count(chain_name1) company_count = get_count(chain_name1)
total_count += company_count total_count += company_count
...@@ -234,8 +233,7 @@ def find_up_thr1(industry_type, industry_id): ...@@ -234,8 +233,7 @@ def find_up_thr1(industry_type, industry_id):
"chain_name_id": chain_two_obj.id "chain_name_id": chain_two_obj.id
} for chain_two_obj in chain_two_obj_list] } for chain_two_obj in chain_two_obj_list]
for item in res_two: for pname_two in res_two:
pname_two = item
chain_name2 = pname_two["chain_name"] chain_name2 = pname_two["chain_name"]
company_count = get_count(chain_name2) company_count = get_count(chain_name2)
total_count += company_count total_count += company_count
...@@ -252,8 +250,7 @@ def find_up_thr1(industry_type, industry_id): ...@@ -252,8 +250,7 @@ def find_up_thr1(industry_type, industry_id):
res_three = [{"chain_name": chain_three_obj.industry_name, res_three = [{"chain_name": chain_three_obj.industry_name,
"chain_name_id": chain_three_obj.id "chain_name_id": chain_three_obj.id
} for chain_three_obj in chain_three_obj_list] } for chain_three_obj in chain_three_obj_list]
for itm in res_three: for pname_thr in res_three:
pname_thr = itm
chain_name3 = pname_thr["chain_name"] chain_name3 = pname_thr["chain_name"]
company_count = get_count(chain_name3) company_count = get_count(chain_name3)
total_count += company_count total_count += company_count
...@@ -266,13 +263,13 @@ def find_up_thr1(industry_type, industry_id): ...@@ -266,13 +263,13 @@ def find_up_thr1(industry_type, industry_id):
"subNodeList": [] "subNodeList": []
} }
node_two["subNodeList"].append(node_thr) node_two["subNodeList"].append(node_thr)
# 一级 # # 一级
node_one = { # node_one = {
"node": "{}".format(chain_name1), # "node": "{}".format(chain_name1),
"level": 2, # "level": 2,
"company_count": total_count, # "company_count": total_count,
"subNodeList": [] # "subNodeList": []
} # }
node_one["subNodeList"].append(node_two) node_one["subNodeList"].append(node_two)
data["subNodeList"].append(node_one) data["subNodeList"].append(node_one)
return data return data
......
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