From 6594d98953134193590b2e2b9d4aaf9dae6a5c19 Mon Sep 17 00:00:00 2001 From: rogersun Date: Fri, 26 Jun 2026 11:33:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ai/utils/show_process.py | 1 + ai/utils/show_prompt.py | 2 +- ai/views.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ai/utils/show_process.py b/ai/utils/show_process.py index c7bbd9b..7fdf8bf 100644 --- a/ai/utils/show_process.py +++ b/ai/utils/show_process.py @@ -21,6 +21,7 @@ def show_main_process(zz_code=None, day_delta=3): test_cinema_list = TestCinema.objects.filter(is_active=True).all() else: test_cinema_list = TestCinema.objects.filter(Q(zz_code=zz_code) & Q(is_active=True)).all() + day_delta = 3 if day_delta is None else int(day_delta) # 获取提示词版本 prompt_ver = PromptTemplate.objects.filter( Q(del_flag=False) & Q(prompt_type='version') & Q(prompt_key='ShowPromptVersion')).first().prompt_val diff --git a/ai/utils/show_prompt.py b/ai/utils/show_prompt.py index 731a3aa..70a2579 100644 --- a/ai/utils/show_prompt.py +++ b/ai/utils/show_prompt.py @@ -41,7 +41,7 @@ class ShowAI: pre_data = pre_data.replace('{history_show}', data.get_show_data(history_start, history_end)) # 处理排片数据 pre_data = pre_data.replace('{history_sales}', data.get_sell_data(history_start, history_end)) # 处理销售数据 pre_data = pre_data.replace('{target_already_show}', - '无' if data.get_show_data(target_start, + '\t无' if data.get_show_data(target_start, target_end) is False else data.get_show_data( target_start, target_end)) # 处理目标日期已排场次数据 pre_data = pre_data.replace('{reference_date}', history_date) # 处理参考日期 diff --git a/ai/views.py b/ai/views.py index fa8bd39..7d989f2 100644 --- a/ai/views.py +++ b/ai/views.py @@ -12,7 +12,7 @@ from ai.utils.basic_func import * @csrf_exempt def manual_general_show(request): zz_code = request.GET.dict().get('cinema_code') - delta = 3 if request.GET.dict().get('delta') is None else int(request.GET.dict().get('delta')) + delta = request.GET.dict().get('delta') result = show_main_process(zz_code, delta) result_dict = { 'status': 'success' if result else 'fail',