ziwen 2 年 前
コミット
fe0fd490ba
1 ファイル変更19 行追加0 行削除
  1. 19 0
      controllers/report.go

+ 19 - 0
controllers/report.go

@@ -2734,6 +2734,19 @@ func (this *ReportController) SearchReportAndResource() {
 	industrialIdArr := make([]int, 0)
 	nowTime := time.Now().Local()
 	threeMonBefore := nowTime.AddDate(0, -3, 0)
+	mapHot := make(map[string]int)
+
+	hotCondition := ` ORDER BY sum_num DESC  `
+	listHot, err := models.GetThemeHeatList(user.UserId, hotCondition, 0, 3)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
+		return
+	}
+	for _, v := range listHot {
+		mapHot[v.IndustryName] = v.IndustrialManagementId
+	}
+
 	for k, v := range listHzResource {
 		// 关联报告发布时间均在3个月内则标记New
 		if v.MinReportTime != "" {
@@ -2746,6 +2759,9 @@ func (this *ReportController) SearchReportAndResource() {
 				listHzResource[k].IsNew = true
 			}
 		}
+		if mapHot[v.IndustryName] > 0 {
+			listHzResource[k].IsHot = true
+		}
 		listHzResource[k].Source = 1
 		if fllowMap[v.IndustrialManagementId] > 0 {
 			listHzResource[k].IsFollw = true
@@ -2765,6 +2781,9 @@ func (this *ReportController) SearchReportAndResource() {
 				listYxResource[k].IsNew = true
 			}
 		}
+		if mapHot[v.IndustryName] > 0 {
+			listYxResource[k].IsHot = true
+		}
 		listYxResource[k].Source = 2
 		if fllowMap[v.IndustrialManagementId] > 0 {
 			listYxResource[k].IsFollw = true