Browse Source

fix-990 fix-984

tags/v1.21.12.1^2
ychao_1983 4 years ago
parent
commit
c06dd3beba
2 changed files with 5 additions and 4 deletions
  1. +4
    -3
      routers/api/v1/repo/repo_dashbord.go
  2. +1
    -1
      routers/repo/repo_statistic.go

+ 4
- 3
routers/api/v1/repo/repo_dashbord.go View File

@@ -5,6 +5,7 @@ import (
"net/http"
"net/url"
"strconv"
"strings"
"time"

"github.com/360EntSecGroup-Skylar/excelize/v2"
@@ -467,7 +468,7 @@ func generateCountSql(beginTime time.Time, endTime time.Time, latestDate string,
"(SELECT repo_id,name,is_private,radar_total from public.repo_statistic where date='" + latestDate + "') B" +
" where A.repo_id=B.repo_id"
if q != "" {
countSql = countSql + " and B.name like '%" + q + "%'"
countSql = countSql + " and LOWER(B.name) like '%" + strings.ToLower(q) + "%'"
}
return countSql
}
@@ -488,7 +489,7 @@ func generateTypeAllSql(beginTime time.Time, endTime time.Time, latestDate strin
" where A.repo_id=B.repo_id"

if q != "" {
sql = sql + " and name like '%" + q + "%'"
sql = sql + " and LOWER(name) like '%" + strings.ToLower(q) + "%'"
}
sql = sql + " order by " + orderBy + " desc,repo_id" + " limit " + strconv.Itoa(pageSize) + " offset " + strconv.Itoa((page-1)*pageSize)
return sql
@@ -511,7 +512,7 @@ func generatePageSql(beginTime time.Time, endTime time.Time, latestDate string,
"(SELECT repo_id,name,owner_name,is_private,radar_total from public.repo_statistic where date='" + latestDate + "') B" +
" where A.repo_id=B.repo_id"
if q != "" {
sql = sql + " and B.name like '%" + q + "%'"
sql = sql + " and LOWER(B.name) like '%" + strings.ToLower(q) + "%'"
}
sql = sql + " order by " + orderBy + " desc,A.repo_id" + " limit " + strconv.Itoa(pageSize) + " offset " + strconv.Itoa((page-1)*pageSize)
return sql


+ 1
- 1
routers/repo/repo_statistic.go View File

@@ -208,7 +208,7 @@ func RepoStatisticDaily(date string) {
maxRepoRadar.Completeness = tempRepoStat.Completeness
}

if tempRepoStat.Liveness < minRepoRadar.Completeness {
if tempRepoStat.Liveness < minRepoRadar.Liveness {
minRepoRadar.Liveness = tempRepoStat.Liveness
}



Loading…
Cancel
Save