mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-01 21:47:57 +01:00
modify sql where condition
This commit is contained in:
parent
5f9edba5a6
commit
f3203272e2
@ -150,8 +150,8 @@ func GetRecentLogs(userID, linesNum int, startTime, endTime string) ([]models.Ac
|
|||||||
func GetTopRepos(countNum int) ([]models.TopRepo, error) {
|
func GetTopRepos(countNum int) ([]models.TopRepo, error) {
|
||||||
|
|
||||||
o := GetOrmer()
|
o := GetOrmer()
|
||||||
|
// hide the where condition: project.public = 1, Can add to the sql when necessary.
|
||||||
sql := "select repo_name, COUNT(repo_name) as access_count from access_log left join project on access_log.project_id=project.project_id where project.public = 1 and access_log.operation = 'pull' group by repo_name order by access_count desc limit ? "
|
sql := "select repo_name, COUNT(repo_name) as access_count from access_log left join project on access_log.project_id=project.project_id where access_log.operation = 'pull' group by repo_name order by access_count desc limit ? "
|
||||||
queryParam := []interface{}{}
|
queryParam := []interface{}{}
|
||||||
queryParam = append(queryParam, countNum)
|
queryParam = append(queryParam, countNum)
|
||||||
var list []models.TopRepo
|
var list []models.TopRepo
|
||||||
|
Loading…
Reference in New Issue
Block a user