Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Limit unanswered question query to available questions #1271

Merged
merged 2 commits into from
Mar 5, 2025

Conversation

sy-records
Copy link
Member

Fix #1268

@LinkinStars LinkinStars self-requested a review March 4, 2025 02:44
@LinkinStars LinkinStars self-assigned this Mar 4, 2025
@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The session.In("question.status", status) may conflict with session.And("question.status = ?", entity.QuestionStatusAvailable)

@LinkinStars LinkinStars merged commit ba9f233 into apache:dev Mar 5, 2025
@sy-records sy-records deleted the fix/unanswered branch March 5, 2025 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants