mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-29 20:18:05 +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) {
|
||||
|
||||
o := GetOrmer()
|
||||
|
||||
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 ? "
|
||||
// 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 access_log.operation = 'pull' group by repo_name order by access_count desc limit ? "
|
||||
queryParam := []interface{}{}
|
||||
queryParam = append(queryParam, countNum)
|
||||
var list []models.TopRepo
|
||||
|
Loading…
Reference in New Issue
Block a user