Sfoglia il codice sorgente

研选榜单列表bug处理

xingzai 2 anni fa
parent
commit
88758b6f08
1 ha cambiato i file con 14 aggiunte e 13 eliminazioni
  1. 14 13
      controllers/report_billboard.go

+ 14 - 13
controllers/report_billboard.go

@@ -55,7 +55,7 @@ func (this *MobileReportBillboardController) ReadList() {
 	}
 	list := make([]*models.ArticleListResp, 0)
 	// 阅读飙升榜
-	if source == 1 {
+	if source == 2 {
 		var topCond string
 		var topPars []interface{}
 		if chartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
@@ -93,20 +93,10 @@ func (this *MobileReportBillboardController) ReadList() {
 		}
 	}
 	// 报告收藏榜
-	if source == 2 {
+	if source == 1 {
 		var collectCond string
 		var collectPars []interface{}
-		if chartPermissionId > 0 {
-			categoryId, err := models.GetCategoryId(chartPermissionId)
-			if err != nil && err.Error() != utils.ErrNoRow() {
-				br.Msg = "获取信息失败"
-				br.ErrMsg = "获取分类权限信息失败,Err:" + err.Error()
-				return
-			}
-			if categoryId != "" {
-				collectCond += ` AND a.category_id IN  (` + categoryId + `)`
-			}
-		}
+
 		// 根据关注时间一个月前至昨日的增量数据排序
 		nowTime := time.Now().Local()
 		startTime := nowTime.AddDate(0, -1, 0)
@@ -122,6 +112,17 @@ func (this *MobileReportBillboardController) ReadList() {
 			}
 			list = topList
 		} else {
+			if chartPermissionId > 0 {
+				categoryId, err := models.GetCategoryId(chartPermissionId)
+				if err != nil && err.Error() != utils.ErrNoRow() {
+					br.Msg = "获取信息失败"
+					br.ErrMsg = "获取分类权限信息失败,Err:" + err.Error()
+					return
+				}
+				if categoryId != "" {
+					collectCond += ` AND a.category_id IN  (` + categoryId + `)`
+				}
+			}
 			collectList, e := models.GetReportCollectionBillboardList(topNum, collectPars, collectCond)
 			if e != nil {
 				br.Msg = "获取失败"