Browse Source

研究汇总--报告精选 只显示最新一期,往期都隐藏

xingzai 2 years ago
parent
commit
b06ea9d611
1 changed files with 7 additions and 3 deletions
  1. 7 3
      controllers/report.go

+ 7 - 3
controllers/report.go

@@ -1286,15 +1286,19 @@ func (this *ReportController) ReportListByType() {
 	}
 	fmt.Println(tbdb)
 	condition = ` AND publish_status = 1  `
-	if reportType == "1" {
-		condition += ` LIMIT 1 `
-	}
+
 	total, err := models.GetCygxReportSelectionPublic(condition, tbdb, pars)
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取帖子总数失败,Err:" + err.Error()
 		return
 	}
+	//研究汇总--报告精选 只显示最新一期,往期都隐藏
+	if reportType == "1" {
+		startSize = 0
+		pageSize = 1
+		total = 1
+	}
 	readSql = ` (SELECT COUNT(1) AS  count  FROM cygx_report_history_record AS h WHERE h.article_id = art.article_id AND  report_type ='` + reportTypeStr + `' AND h.user_id = ` + strconv.Itoa(uid) + `) as read_num`
 	page = paging.GetPaging(currentIndex, pageSize, total)
 	list, err := models.GetReportSelectionListPublic(condition, readSql, tbdb, pars, startSize, pageSize)