This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git

commit 0f7deb6c79b2a3829caf22a7709c14768d6232bd
Author: sy-records <[email protected]>
AuthorDate: Mon Mar 3 19:38:44 2025 +0800

    fix: Limit unanswered question query to available questions
---
 internal/repo/question/question_repo.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/internal/repo/question/question_repo.go 
b/internal/repo/question/question_repo.go
index c144411b..38310059 100644
--- a/internal/repo/question/question_repo.go
+++ b/internal/repo/question/question_repo.go
@@ -417,6 +417,7 @@ func (qr *questionRepo) GetQuestionPage(ctx 
context.Context, page, pageSize int,
                session.OrderBy("question.pin desc,question.vote_count DESC, 
question.view_count DESC")
        case "unanswered":
                session.Where("question.answer_count = 0")
+               session.And("question.status = ?", 
entity.QuestionStatusAvailable)
                session.OrderBy("question.pin desc,question.created_at DESC")
        case "frequent":
                session.OrderBy("question.pin DESC, question.linked_count DESC, 
question.updated_at DESC")

Reply via email to