|
@@ -596,6 +596,7 @@ func (this *SearchController) ListHomeArtAndChartPage() {
|
|
|
resp.ChartList = chartList
|
|
|
var result []*models.SearchItem
|
|
|
var total int64
|
|
|
+ var articleIds []int
|
|
|
if listType == 1 || listType == 2 {
|
|
|
//添加映射关系
|
|
|
keyWord = strings.ToUpper(keyWord)
|
|
@@ -667,6 +668,7 @@ func (this *SearchController) ListHomeArtAndChartPage() {
|
|
|
}
|
|
|
result[k].Source = 1
|
|
|
v.PublishDate = utils.TimeRemoveHms(v.PublishDate)
|
|
|
+ articleIds = append(articleIds, v.ArticleId)
|
|
|
}
|
|
|
}
|
|
|
//记录用户搜索关键词
|
|
@@ -687,6 +689,11 @@ func (this *SearchController) ListHomeArtAndChartPage() {
|
|
|
}
|
|
|
if len(result) == 0 {
|
|
|
result = make([]*models.SearchItem, 0)
|
|
|
+ } else {
|
|
|
+ yxArticleIdMap := services.GetYxArticleIdMap(articleIds)
|
|
|
+ for _, v := range result {
|
|
|
+ v.IsResearch = yxArticleIdMap[v.ArticleId] // 添加是否属于研选的标识
|
|
|
+ }
|
|
|
}
|
|
|
page := paging.GetPaging(currentIndex, pageSize, int(total))
|
|
|
resp.Paging = page
|