Skip to content

Commit b68eda5

Browse files
committed
prefer latest updated issues
1 parent e952ac7 commit b68eda5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

models/issues/issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ func FindIssuesSuggestionByKeyword(ctx context.Context, repoID int64, keyword st
530530
err := db.GetEngine(ctx).Where("repo_id = ?", repoID).
531531
And(isPullToCond(isPull)).
532532
And(cond).
533-
OrderBy("`index` DESC").
533+
OrderBy("updated_unix DESC, `index` DESC").
534534
Limit(pageSize).
535535
Find(&issues)
536536
return issues, err

services/issue/suggestion_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ func Test_Suggestion(t *testing.T) {
2626
}{
2727
{
2828
keyword: "",
29-
expectedIndexes: []int64{5, 4, 3, 2, 1},
29+
expectedIndexes: []int64{5, 1, 4, 2, 3},
3030
},
3131
{
3232
keyword: "1",
3333
expectedIndexes: []int64{1},
3434
},
3535
{
3636
keyword: "issue",
37-
expectedIndexes: []int64{4, 3, 2, 1},
37+
expectedIndexes: []int64{4, 1, 2, 3},
3838
},
3939
{
4040
keyword: "pull",

0 commit comments

Comments
 (0)