Browse Source

fix:最新研报品种名称显示

zqbao 8 months ago
parent
commit
0b3721952b
1 changed files with 11 additions and 1 deletions
  1. 11 1
      controllers/report.go

+ 11 - 1
controllers/report.go

@@ -610,6 +610,16 @@ func (this *ReportController) RecentList() {
 		classifyPermissionMap[v.ClassifyId] = v.PermissionNames
 	}
 	for _, v := range reportPdfList {
+		var reportClassifyId int
+		if v.ClassifyIdFirst != 0 {
+			reportClassifyId = v.ClassifyIdFirst
+		}
+		if v.ClassifyIdSecond != 0 {
+			reportClassifyId = v.ClassifyIdSecond
+		}
+		if v.ClassifyIdThird != 0 {
+			reportClassifyId = v.ClassifyIdThird
+		}
 		reportList.List = append(reportList.List, &models.ReportView{
 			Id:                 v.ReportPdfId,
 			ClassifyIdFirst:    v.ClassifyIdFirst,
@@ -618,7 +628,7 @@ func (this *ReportController) RecentList() {
 			ClassifyNameSecond: v.ClassifyNameSecond,
 			ClassifyIdThird:    v.ClassifyIdThird,
 			ClassifyNameThird:  v.ClassifyNameThird,
-			PermissionNames:    classifyPermissionMap[v.ClassifyIdSecond],
+			PermissionNames:    classifyPermissionMap[reportClassifyId],
 			PdfUrl:             v.PdfUrl,
 			Title:              v.Title,
 			Abstract:           v.Abstract,