Browse Source

搜索页添加是否需要跳转地址

xingzai 2 years ago
parent
commit
22a1db91bc
2 changed files with 7 additions and 0 deletions
  1. 6 0
      controllers/search.go
  2. 1 0
      models/search.go

+ 6 - 0
controllers/search.go

@@ -331,6 +331,12 @@ func (this *BaseSearchController) SearchListPublic() {
 			go models.AddSearchKeyWord(keyWordItem)
 		}
 	}
+
+	for k, _ := range result {
+		if result[k].ArticleId < utils.SummaryArticleId {
+			result[k].IsNeedJump = true
+		}
+	}
 	resp := new(models.SearchResp)
 	page := paging.GetPaging(currentIndex, pageSize, int(total))
 	resp.Paging = page

+ 1 - 0
models/search.go

@@ -14,6 +14,7 @@ type SearchItem struct {
 	ImgUrlPc         string   `description:"图片链接"`
 	CategoryId       string   `description:"文章分类"`
 	Source           int      `description:"来源  1:文章, 2:图表"`
+	IsNeedJump       bool     `description:"是否需要跳转链接地址"`
 }
 
 type CategoryItem struct {