diff --git a/routers/search.go b/routers/search.go index 646b5b5c8..7fbe42ff3 100644 --- a/routers/search.go +++ b/routers/search.go @@ -106,7 +106,9 @@ func searchRepoByLabel(ctx *context.Context, Key string, Page int, PageSize int) log.Info("WebTotal=" + fmt.Sprint(WebTotal)) log.Info("PrivateTotal=" + fmt.Sprint(PrivateTotal)) resultObj.Result = make([]map[string]interface{}, 0) - + if from == 0 { + WebTotal = 0 + } if ctx.User != nil && (from < PrivateTotal || from == 0) { orderBy := models.SearchOrderByRecentUpdated 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("PrivateTotal=" + fmt.Sprint(PrivateTotal)) resultObj.Result = make([]map[string]interface{}, 0) - + if from == 0 { + WebTotal = 0 + } if ctx.User != nil && (from < PrivateTotal || from == 0) { orderBy := models.SearchOrderByRecentUpdated switch SortBy { @@ -749,6 +753,9 @@ func searchIssue(ctx *context.Context, TableName string, Key string, Page int, P WebTotal := ctx.QueryInt("WebTotal") from := (Page - 1) * PageSize + if from == 0 { + WebTotal = 0 + } resultObj := &SearchRes{} log.Info("WebTotal=" + fmt.Sprint(WebTotal)) log.Info("PrivateTotal=" + fmt.Sprint(PrivateTotal))