Browse Source

no message

xingzai 1 year ago
parent
commit
29144f54a2
2 changed files with 3 additions and 0 deletions
  1. 2 0
      controllers/search.go
  2. 1 0
      models/search.go

+ 2 - 0
controllers/search.go

@@ -692,8 +692,10 @@ func (this *SearchController) ListHomeArtAndChartPage() {
 		result = make([]*models.SearchItem, 0)
 	} else {
 		yxArticleIdMap := services.GetYxArticleIdMap(articleIds)
+		articleMapPv := services.GetArticleHistoryByArticleId(articleIds) //文章Pv
 		for _, v := range result {
 			v.IsResearch = yxArticleIdMap[v.ArticleId] // 添加是否属于研选的标识
+			v.Pv = articleMapPv[v.ArticleId]           // 添加是否属于研选的标识
 		}
 	}
 	page := paging.GetPaging(currentIndex, pageSize, int(total))

+ 1 - 0
models/search.go

@@ -16,6 +16,7 @@ type SearchItem struct {
 	Source           int      `description:"来源  1:文章, 2:图表"`
 	IsNeedJump       bool     `description:"是否需要跳转链接地址"`
 	IsResearch       bool     `description:"是否属于研选"`
+	Pv               int      `description:"Pv"`
 }
 
 type CategoryItem struct {