Skip to content

Commit

Permalink
fix:修复获取最近的历史消息的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zgqgit committed Jul 8, 2024
1 parent 50a8c4f commit c744a15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/bisheng/database/models/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def get_latest_message_by_chat_ids(cls, chat_ids: list[str], category: str = Non
statement = select(ChatMessage).where(ChatMessage.chat_id.in_(chat_ids))
if category:
statement = statement.where(ChatMessage.category == category)
statement = statement.order_by(ChatMessage.create_time.desc()).limit(1)
statement = statement.order_by(ChatMessage.create_time.desc())
with session_getter() as session:
return session.exec(statement).all()

Expand Down

0 comments on commit c744a15

Please sign in to comment.