From 810a36d757d66d1eb10b5fb46165b4ce08d00f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B2=E8=BE=B0=E7=94=9F=E4=BA=A7?= Date: Sat, 11 Apr 2026 22:00:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E6=9C=9F=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/routers/information.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/app/routers/information.py b/backend/app/routers/information.py index e8dee6d..eb1f6c3 100644 --- a/backend/app/routers/information.py +++ b/backend/app/routers/information.py @@ -127,9 +127,10 @@ def get_information_list( if user_id: query = query.filter(Information.user_id == user_id) - # 成交日期过滤 + # 成交日期过滤 - 使用cast确保字符串与date字段正确比较 if deal_date: - query = query.filter(Information.deal_date == deal_date) + from sqlalchemy import cast, String + query = query.filter(cast(Information.deal_date, String) == deal_date) # 按创建时间倒序 query = query.order_by(Information.created_at.desc())