diff --git a/ai/utils/basic_func.py b/ai/utils/basic_func.py index 246f5e0..7c65c6e 100644 --- a/ai/utils/basic_func.py +++ b/ai/utils/basic_func.py @@ -159,7 +159,7 @@ def count_show(show_data): show_count = [] for show, count in show_dict.items(): show_count.append(f"{show}:{str(round(count / len(show_data) * 100, 2))}%,共排{str(count)}场") - return '\n'.join(show_count) + return '\n'.join(show_count), f"共{len(show_data)}场" # 处理黑名单 diff --git a/ai/views.py b/ai/views.py index 3fb8da7..fb94809 100644 --- a/ai/views.py +++ b/ai/views.py @@ -87,10 +87,10 @@ def report(request): # 获取影厅制式 hall_type = get_hall_type(cinema_code=zz_code) # 计算排片占比 - ai_count = count_show(ai_dict) - real_count = count_show(real_dict) - target_count = count_show(target_dict) - template_count = count_show(temp_dict) + ai_count, ai_total = count_show(ai_dict) + real_count, real_total = count_show(real_dict) + target_count, target_total = count_show(target_dict) + template_count, template_total = count_show(temp_dict) # 生成时间 create_time = datetime.datetime.strftime((last_ai_data.created_at + datetime.timedelta(hours=8)), '%Y-%m-%d %H:%M:%S') @@ -120,6 +120,10 @@ def report(request): 'real_count': real_count, 'target_count': target_count, 'template_count': template_count, + 'ai_total': ai_total, + 'real_total': real_total, + 'target_total': target_total, + 'template_total': template_total, 'result': last_ai_data.result, 'think': think, 'ai_model': last_ai_data.ai_model,