modify sql where condition

This commit is contained in:
wemeya 2016-06-22 16:36:36 +08:00
parent 5f9edba5a6
commit f3203272e2

View File

@ -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