Browse Source

no message

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

+ 2 - 1
controllers/search.go

@@ -250,7 +250,7 @@ func (this *MobileSearchController) ListHomeArtAndChart() {
 			articleIds = append(articleIds, v.ArticleId)
 		}
 	}
-
+	articleMapPv := services.GetArticleHistoryByArticleId(articleIds) //文章Pv
 	//ListType   query   int  true       "列表类型,1最新/全部,2 纪要 ,3图表 默认1"
 	//记录用户搜索关键词
 	//var source int
@@ -277,6 +277,7 @@ func (this *MobileSearchController) ListHomeArtAndChart() {
 		yxArticleIdMap := services.GetYxArticleIdMap(articleIds)
 		for _, v := range result {
 			v.IsResearch = yxArticleIdMap[v.ArticleId] // 添加是否属于研选的标识
+			v.Pv = articleMapPv[v.ArticleId]           // 添加Pv
 		}
 	}
 	page := paging.GetPaging(currentIndex, pageSize, int(total))

+ 1 - 0
models/search.go

@@ -14,6 +14,7 @@ type SearchItem struct {
 	CategoryId       string   `description:"文章分类"`
 	Source           int      `description:"来源  1:文章, 2:图表"`
 	IsResearch       bool     `description:"是否属于研选"`
+	Pv               int      `description:"Pv"`
 }
 
 type CategoryItem struct {