xingzai %!s(int64=2) %!d(string=hai) anos
pai
achega
7da505b934
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      controllers/search.go

+ 3 - 2
controllers/search.go

@@ -1,6 +1,7 @@
 package controllers
 
 import (
+	"fmt"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"hongze/hongze_clpt/models"
 	"hongze/hongze_clpt/services"
@@ -187,7 +188,7 @@ func (this *MobileSearchController) ListHomeArtAndChart() {
 			return
 		}
 		result = tmpResult
-
+		fmt.Println(tmpTotalResult)
 		if int(tmpTotalResult) < currentIndex*pageSize {
 			startSizeBody := startSize - int(tmpTotalResult)
 			if startSizeBody < 0 {
@@ -213,7 +214,7 @@ func (this *MobileSearchController) ListHomeArtAndChart() {
 				startSizeIk = 0
 			}
 			var pageSizeIk int
-			pageSizeIk = pageSize - len(tmpResult)
+			pageSizeIk = pageSize - len(result)
 			tmpResultIk, _, err := services.EsArticleSearch(keyWord, startSizeIk, pageSizeIk, orderColumn, 2)
 			if err != nil {
 				br.Msg = "检索失败"