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())