|
@@ -498,10 +498,12 @@ class ReportPush(object):
|
|
|
data_overview = self.data_overview(time_range, house_ids, xcx_top_data_part, brand_top_data_part)
|
|
|
result_data_1.extend(data_overview)
|
|
|
# 4:单个项目小程序数据排行榜
|
|
|
+ # 排名 项目名称 总浏览量 总浏览人数 新增获客 新增获电
|
|
|
for index, x in enumerate(xcx_top_data_part):
|
|
|
if x[0] in house_ids:
|
|
|
result_data_4.append([index, x[1], x[2], x[3], x[4], x[5]])
|
|
|
# 5: 集团项目数据排行榜
|
|
|
+ # 排名 项目名称 总浏览量 总浏览人数 新增获客 新增获电
|
|
|
if customer_type == 2:
|
|
|
for index, x2 in enumerate(brand_top_data_part):
|
|
|
if x2[1] in house_ids or x2[0] in brand_id_list:
|
|
@@ -515,38 +517,67 @@ class ReportPush(object):
|
|
|
else:
|
|
|
pass
|
|
|
# 2: 项目数据排行榜
|
|
|
+ # 排名 项目名称 总浏览量 总浏览人数 新增获客 新增获电
|
|
|
house_with_brand_data = self.house_with_brand(xcx_top_data_part, brand_top_data_part)
|
|
|
for x in house_with_brand_data:
|
|
|
if x[2] in house_ids:
|
|
|
+ x.pop(1)
|
|
|
+ x.pop(2)
|
|
|
result_data_2.append(x)
|
|
|
|
|
|
# 3: 项目历史累计总数
|
|
|
+ # 排名 项目名称 总浏览量 总浏览人数 新增获客 新增获电
|
|
|
if customer_type == 2:
|
|
|
all_data_history = self.house_with_brand(xcx_top_data_all_part, brand_top_data_all_part, brand_id_list)
|
|
|
for index, x in enumerate(all_data_history):
|
|
|
if x[2] in house_ids or x[1] in brand_id_list:
|
|
|
+ x.pop(1)
|
|
|
+ x.pop(2)
|
|
|
result_data_3.append(x)
|
|
|
else:
|
|
|
all_data_history = self.house_with_brand(xcx_top_data_all_part, brand_top_data_all_part)
|
|
|
for index, x in enumerate(all_data_history):
|
|
|
if x[2] in house_ids:
|
|
|
+ x.pop(1)
|
|
|
+ x.pop(2)
|
|
|
result_data_3.append(x)
|
|
|
|
|
|
# 7: 单个项目小程序获客来源场景分析
|
|
|
+ # 项目 合计 长按识别二维码 会话 公众号菜单 公众号文章 小程序历史列表 扫一扫二维码 搜索 相册选取二维码 其他小程序 其他
|
|
|
for x in customer_channel_details_data:
|
|
|
if x[0] in house_ids:
|
|
|
- result_data_7.append(x)
|
|
|
+ house_name = x[1]
|
|
|
+ ele = [house_name]
|
|
|
+ data = x[2:]
|
|
|
+ total = sum(data)
|
|
|
+ ele.append(total)
|
|
|
+ ele.extend(data)
|
|
|
+ result_data_7.append(data)
|
|
|
|
|
|
# 8: 集团项目获客来源场景分析
|
|
|
if customer_type == 2:
|
|
|
for x in brand_customer_channel_details:
|
|
|
if x[2] in house_ids or x[0] in brand_id_list:
|
|
|
- result_data_8.append(x)
|
|
|
- pass
|
|
|
+ ele = []
|
|
|
+ house_name = x[3]
|
|
|
+ data = x[4:]
|
|
|
+ total = sum(data)
|
|
|
+ ele.append(house_name)
|
|
|
+ ele.append(total)
|
|
|
+ ele.extend(data)
|
|
|
+ result_data_8.append(ele)
|
|
|
elif customer_type == 1:
|
|
|
for x in brand_customer_channel_details:
|
|
|
if x[2] in house_ids:
|
|
|
- result_data_8.append(x)
|
|
|
+ ele = []
|
|
|
+ house_name = x[3]
|
|
|
+ data = x[4:]
|
|
|
+ total = sum(data)
|
|
|
+ ele.append(house_name)
|
|
|
+ ele.append(total)
|
|
|
+ ele.extend(data)
|
|
|
+ result_data_8.append(ele)
|
|
|
+ result_data_8.append(ele)
|
|
|
|
|
|
# 6: 项目获客来源场景分析
|
|
|
result_data_6 = self.house_with_brand_for_share(result_data_7, result_data_8)
|