Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.3.2^2
zouap 3 years ago
parent
commit
29bb060e42
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      routers/search.go

+ 9
- 2
routers/search.go View File

@@ -106,7 +106,9 @@ func searchRepoByLabel(ctx *context.Context, Key string, Page int, PageSize int)
log.Info("WebTotal=" + fmt.Sprint(WebTotal)) log.Info("WebTotal=" + fmt.Sprint(WebTotal))
log.Info("PrivateTotal=" + fmt.Sprint(PrivateTotal)) log.Info("PrivateTotal=" + fmt.Sprint(PrivateTotal))
resultObj.Result = make([]map[string]interface{}, 0) resultObj.Result = make([]map[string]interface{}, 0)

if from == 0 {
WebTotal = 0
}
if ctx.User != nil && (from < PrivateTotal || from == 0) { if ctx.User != nil && (from < PrivateTotal || from == 0) {
orderBy := models.SearchOrderByRecentUpdated orderBy := models.SearchOrderByRecentUpdated
switch SortBy { switch SortBy {
@@ -214,7 +216,9 @@ func searchRepo(ctx *context.Context, TableName string, Key string, Page int, Pa
log.Info("WebTotal=" + fmt.Sprint(WebTotal)) log.Info("WebTotal=" + fmt.Sprint(WebTotal))
log.Info("PrivateTotal=" + fmt.Sprint(PrivateTotal)) log.Info("PrivateTotal=" + fmt.Sprint(PrivateTotal))
resultObj.Result = make([]map[string]interface{}, 0) resultObj.Result = make([]map[string]interface{}, 0)

if from == 0 {
WebTotal = 0
}
if ctx.User != nil && (from < PrivateTotal || from == 0) { if ctx.User != nil && (from < PrivateTotal || from == 0) {
orderBy := models.SearchOrderByRecentUpdated orderBy := models.SearchOrderByRecentUpdated
switch SortBy { switch SortBy {
@@ -749,6 +753,9 @@ func searchIssue(ctx *context.Context, TableName string, Key string, Page int, P
WebTotal := ctx.QueryInt("WebTotal") WebTotal := ctx.QueryInt("WebTotal")


from := (Page - 1) * PageSize from := (Page - 1) * PageSize
if from == 0 {
WebTotal = 0
}
resultObj := &SearchRes{} resultObj := &SearchRes{}
log.Info("WebTotal=" + fmt.Sprint(WebTotal)) log.Info("WebTotal=" + fmt.Sprint(WebTotal))
log.Info("PrivateTotal=" + fmt.Sprint(PrivateTotal)) log.Info("PrivateTotal=" + fmt.Sprint(PrivateTotal))


Loading…
Cancel
Save