From 416204be0c74abe15799fb42ac9df90b71b749d9 Mon Sep 17 00:00:00 2001 From: rogersun Date: Fri, 10 Jul 2026 15:48:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=91=8A=E5=A2=9E=E5=8A=A0=E6=80=BB?= =?UTF-8?q?=E5=9C=BA=E6=AC=A1=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ai/utils/basic_func.py | 2 +- ai/views.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) 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,