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