diff --git a/backend/apps/chat/curd/chat.py b/backend/apps/chat/curd/chat.py
index f6dafb443..711c20515 100644
--- a/backend/apps/chat/curd/chat.py
+++ b/backend/apps/chat/curd/chat.py
@@ -42,13 +42,16 @@ def list_chats(session: SessionDep, current_user: CurrentUser) -> List[Chat]:
def list_recent_questions(session: SessionDep, current_user: CurrentUser, datasource_id: int) -> List[str]:
chat_records = (
- session.query(ChatRecord.question)
+ session.query(
+ ChatRecord.question,
+ func.count(ChatRecord.question).label('question_count')
+ )
.filter(
ChatRecord.datasource == datasource_id,
ChatRecord.question.isnot(None)
)
.group_by(ChatRecord.question)
- .order_by(desc(func.max(ChatRecord.create_time)))
+ .order_by(desc('question_count'), desc(func.max(ChatRecord.create_time)))
.limit(10)
.all()
)
diff --git a/frontend/src/views/chat/QuickQuestion.vue b/frontend/src/views/chat/QuickQuestion.vue
index fa6fe5082..dd412a59d 100644
--- a/frontend/src/views/chat/QuickQuestion.vue
+++ b/frontend/src/views/chat/QuickQuestion.vue
@@ -1,11 +1,11 @@
+
+
+