Merge remote-tracking branch 'origin/dev' into super
This commit is contained in:
commit
1d9f854ce4
23 files changed
+1034
-333
No files matched your search
@@ -253,12 +253,12 @@ def submit_feedback():
|
||||
return jsonify({'error': 'Missing user or agent context'}), 500
|
||||
|
||||
# 构造查询:限定在当前用户和 Agent 范围内
|
||||
query = ChatLog.query.filter_by(user_id=user.id, agent_id=agent.id)
|
||||
chat_logs_query = db.session.query(ChatLog).filter_by(user_id=user.id, agent_id=agent.id)
|
||||
if conversation_id:
|
||||
query = query.filter_by(conversation_id=conversation_id)
|
||||
chat_logs_query = chat_logs_query.filter_by(conversation_id=conversation_id)
|
||||
|
||||
# 取最新一条对话日志
|
||||
chat_log = query.order_by(ChatLog.created_at.desc()).first()
|
||||
chat_log = chat_logs_query.order_by(ChatLog.created_at.desc()).first()
|
||||
if not chat_log:
|
||||
return jsonify({'error': 'ChatLog not found'}), 404
|
||||
|
||||
|
||||
Reference in new issue
Block a user