From 01c80653d9a38c277c111f78b24558d9c51dfdc1 Mon Sep 17 00:00:00 2001 From: mxwj Date: Sat, 9 Nov 2024 22:08:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E8=B4=A2=E6=8A=A5?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=8E=A5=E5=8F=A3=E4=BD=BF=E7=94=A8=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E8=AF=8D=E6=9F=A5=E8=AF=A2=E6=97=B6=E7=9A=84=E6=80=BB?= =?UTF-8?q?=E6=98=AF=E8=BF=94=E5=9B=9E=E7=A9=BA=E5=80=BC=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/financial_reports/service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/financial_reports/service.py b/src/financial_reports/service.py index bc5e11c..7c3fee6 100644 --- a/src/financial_reports/service.py +++ b/src/financial_reports/service.py @@ -51,8 +51,8 @@ async def financial_reports_query_service( # 如果没有匹配的股票代码,返回空查询 query_set = query_set.none() elif keyword_type == "code": - # 精确查询股票代码字段 - query_set = query_set.filter(stock_code=search_keyword) + # 模糊查询代码 + query_set = query_set.filter(stock_code__icontains=search_keyword) elif keyword_type == "chinese": # 模糊查询股票名称字段 query_set = query_set.filter(stock_name__icontains=search_keyword)