修复日期过滤
This commit is contained in:
parent
4f6de4d3ac
commit
810a36d757
|
|
@ -127,9 +127,10 @@ def get_information_list(
|
||||||
if user_id:
|
if user_id:
|
||||||
query = query.filter(Information.user_id == user_id)
|
query = query.filter(Information.user_id == user_id)
|
||||||
|
|
||||||
# 成交日期过滤
|
# 成交日期过滤 - 使用cast确保字符串与date字段正确比较
|
||||||
if deal_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())
|
query = query.order_by(Information.created_at.desc())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue