xingzai před 2 roky
rodič
revize
2945f8af31
1 změnil soubory, kde provedl 7 přidání a 6 odebrání
  1. 7 6
      controllers/home.go

+ 7 - 6
controllers/home.go

@@ -373,11 +373,11 @@ func (this *HomeController) ListHomeArtAndChart() {
 		}
 	} else if listType == 3 {
 		if chartPermissionId > 0 {
-			condition += ` AND a.ptag_id>=? `
+			condition += ` AND a.ptag_id =? `
 			pars = append(pars, chartPermissionId)
 		}
 		if ctagId > 0 {
-			condition += ` AND a.ctag_id>=? `
+			condition += ` AND a.ctag_id =? `
 			pars = append(pars, ctagId)
 		}
 		chartList, err = models.GetChartList(condition, pars, startSize, pageSize)
@@ -447,10 +447,7 @@ func (this *HomeController) ListHomeArtAndChart() {
 			br.Msg = "获取帖子总数失败,Err:" + err.Error()
 			return
 		}
-		if chartTotal > total {
-			total = chartTotal
-		}
-		page = paging.GetPaging(currentIndex, pageSize, total)
+
 		list, err := models.GetHomeList(condition, pars, startSize, pageSize)
 		if err != nil {
 			br.Msg = "获取信息失败"
@@ -514,6 +511,10 @@ func (this *HomeController) ListHomeArtAndChart() {
 		}
 		resp.List = list
 	}
+	if chartTotal > total {
+		total = chartTotal
+	}
+	page = paging.GetPaging(currentIndex, pageSize, total)
 	resp.Paging = page
 	br.Ret = 200
 	br.Success = true