From b883a8e4594853ab721418d45558c19fbf5fd06f Mon Sep 17 00:00:00 2001 From: rogersun Date: Tue, 9 Jun 2026 15:41:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=A2=84=E4=BC=B0=E9=94=80?= =?UTF-8?q?=E5=94=AE=E6=95=B0=E6=8D=AE=E6=94=B9=E4=B8=BA=E6=AD=A3=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ai/utils/show_process.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ai/utils/show_process.py b/ai/utils/show_process.py index 99d5844..aa9f5fc 100644 --- a/ai/utils/show_process.py +++ b/ai/utils/show_process.py @@ -2,6 +2,7 @@ from ai.models import * from ai.utils.show_prompt import * import datetime from django_redis import get_redis_connection +import re # ai排片主流程 def show_main_process(): @@ -31,8 +32,8 @@ def show_main_process(): _show = _show.strip() print('_show:', _show) # 获取销售额 - _sales = next((s for s in result.split('\n') if s.startswith('预估销售数据')), '').replace('预估销售数据:', '') - _sales = _sales.replace('约', '').replace('元', '') + _sales = next((s for s in result.split('\n') if re.search('预估销售数据', s)), '') + _sales = str(re.findall(r'\d+\.?\d*', _sales)[0]) print('_sales:', _sales) # 处理返回结果 try: