xingzai hace 11 meses
padre
commit
ccf5cf986f
Se han modificado 2 ficheros con 4 adiciones y 4 borrados
  1. 2 2
      controllers/research.go
  2. 2 2
      controllers/yanxuan_special.go

+ 2 - 2
controllers/research.go

@@ -787,7 +787,7 @@ func (this *ResearchController) ArticleNewList() {
 	articleCollectNumMap, _ := services.GetCygxArticleCollectNumMapByArtcileIds(articleIds) //文章收藏的数量
 	articleCollectYanxuanSpecialMap, _ := services.GetYanxuanSpecialCollectMap(user.UserId) //用户收藏的研选专栏
 
-	pvMap := services.GetYanxuanSpecialRecordByYanxuanSpecialId(articleIdsSpecialArr)
+	yanxuanSpecialPv := services.GetYanxuanSpecialRecordByYanxuanSpecialId(articleIdsSpecialArr)
 
 	//处理关联的产业
 	industrialMap, err := services.GetArticleIndustrialByArticleId(articleIds)
@@ -799,7 +799,7 @@ func (this *ResearchController) ArticleNewList() {
 	for k, v := range list {
 		if v.IsSpecial == 1 {
 			v.IsCollect = articleCollectYanxuanSpecialMap[v.ArticleId]
-			v.Pv = pvMap[v.ArticleId]
+			v.Pv = yanxuanSpecialPv[v.ArticleId]
 		} else {
 			v.Pv = articleMapPv[v.ArticleId]
 			v.CollectNum = articleCollectNumMap[v.ArticleId]

+ 2 - 2
controllers/yanxuan_special.go

@@ -82,7 +82,7 @@ func (this *YanxuanSpecialController) List() {
 		yanxuanSpecialIds = append(yanxuanSpecialIds, v.Id)
 	}
 
-	pvMap := services.GetYanxuanSpecialRecordByYanxuanSpecialId(yanxuanSpecialIds)
+	yanxuanSpecialPv := services.GetYanxuanSpecialRecordByYanxuanSpecialId(yanxuanSpecialIds)
 
 	for _, v := range list {
 		hasImg, err := utils.ArticleHasImgUrl(v.Content)
@@ -122,7 +122,7 @@ func (this *YanxuanSpecialController) List() {
 			}
 			v.Tags += v.IndustryTags
 		}
-		v.Pv = pvMap[v.Id]
+		v.Pv = yanxuanSpecialPv[v.Id]
 	}
 
 	isAuthor, isImproveInformation := services.GetYanxuanSpecialAuthorInfo(sysUser) //用户是否没开通研选专栏以及,专栏信息是否完善