Browse Source

产业报告--策略,列表显示内容修改

xingzai 2 years ago
parent
commit
69a18adfef
2 changed files with 14 additions and 7 deletions
  1. 13 7
      controllers/tactics.go
  2. 1 0
      models/article.go

+ 13 - 7
controllers/tactics.go

@@ -134,13 +134,6 @@ func (this *TacticsController) List() {
 		br.Msg = "获取帖子数据失败,Err:" + err.Error()
 		return
 	}
-	lenList := len(list)
-	for i := 0; i < lenList; i++ {
-		item := list[i]
-		list[i].Body, _ = services.GetReportContentTextSub(item.Body)
-		//list[i].Abstract = html.UnescapeString(item.Abstract)
-		list[i].Abstract, _ = services.GetReportContentTextSub(item.Abstract)
-	}
 
 	for k, v := range list {
 		if v.Readnum == 0 && user.CreatedTime.Before(utils.StrTimeToTime(v.PublishDate)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(v.PublishDate)) {
@@ -157,6 +150,19 @@ func (this *TacticsController) List() {
 		}
 		resp.MatchTypeName = detail.MatchTypeName
 	}
+	lenList := len(list)
+	for i := 0; i < lenList; i++ {
+		item := list[i]
+		list[i].Body, _ = services.GetReportContentTextSub(item.Body)
+		//list[i].Abstract = html.UnescapeString(item.Abstract)
+		list[i].Abstract, _ = services.GetReportContentTextSub(item.Abstract)
+		list[i].Annotation, _ = services.GetReportContentTextSub(item.Annotation)
+		//行业比较研究、资金流向,显示报告的摘要
+		if resp.MatchTypeName == "行业比较研究" || resp.MatchTypeName == "资金流向" {
+			list[i].Annotation = list[i].Abstract
+		}
+	}
+
 	resp.CategoryImgUrlPc = mapChartPermission[detail.ChartPermissionName]
 	resp.List = list
 	resp.Paging = page

+ 1 - 0
models/article.go

@@ -372,6 +372,7 @@ type ReportArticle struct {
 	IsHaveVideo      bool   `description:"是否含有音频文件"`
 	ImgUrlPc         string `description:"图片链接"`
 	CategoryId       string `description:"文章分类"`
+	Annotation       string `description:"核心观点"`
 }
 
 func GetReportPermission(categoryName string) (item []*ChartPermission, err error) {