Browse Source

提交代码

tags/v1.22.4.2^2
ychao_1983 3 years ago
parent
commit
20d0522e98
2 changed files with 5 additions and 2 deletions
  1. +1
    -0
      models/repo_list.go
  2. +4
    -2
      routers/home.go

+ 1
- 0
models/repo_list.go View File

@@ -221,6 +221,7 @@ const (
SearchOrderByHot SearchOrderBy = "(num_watches + num_stars + num_forks + clone_cnt) DESC"
SearchOrderByActive SearchOrderBy = "(num_issues + num_pulls + num_commit) DESC"
SearchOrderByWatches SearchOrderBy = "num_watches DESC"
SearchOrderByDefault SearchOrderBy = "recommend desc,num_stars DESC,updated_unix DESC"
)

// SearchRepositoryCondition creates a query condition according search repository options


+ 4
- 2
routers/home.go View File

@@ -309,9 +309,11 @@ func ExploreDatasets(ctx *context.Context) {
orderBy = models.SearchOrderByStarsReverse
case "feweststars":
orderBy = models.SearchOrderByStars
case "default":
orderBy = models.SearchOrderByDefault
default:
ctx.Data["SortType"] = "recentupdate"
orderBy = models.SearchOrderByRecentUpdated
ctx.Data["SortType"] = "default"
orderBy = models.SearchOrderByDefault
}

keyword := strings.Trim(ctx.Query("q"), " ")


Loading…
Cancel
Save