ziwen hace 2 años
padre
commit
5de6e517b9

+ 9 - 5
controller/pc/pc.go

@@ -143,10 +143,11 @@ func ClassifyDetailBanner(c *gin.Context) {
 			return
 		}
 		resp := &pcModels.DetailBannerResp{
-			ReportId: chapterItem.ReportId,
-			Stage:    chapterItem.Stage,
-			ImgUrl:   "",
-			Type:     "报告合集",
+			ReportId:          chapterItem.ReportId,
+			ClassifyNameFirst: chapterItem.ClassifyNameFirst,
+			Stage:             chapterItem.Stage,
+			ImgUrl:            "",
+			Type:              "报告合集",
 		}
 		bannerResp = resp
 	} else {
@@ -176,9 +177,12 @@ func ClassifyDetailBanner(c *gin.Context) {
 			VipTitle:           reportItem.VipTitle,
 			Author:             reportItem.Author,
 			ImgUrl:             "",
+			ClassifyNameFirst:  reportItem.ClassifyNameFirst,
+			ClassifyIdFirst:    reportItem.ClassifyIdFirst,
 			ClassifyNameSecond: reportItem.ClassifyNameSecond,
+			ClassifyIdSecond:   reportItem.ClassifyIdSecond,
 		}
-		if classifyName == "月报"|| classifyName == "双周报"|| classifyName == "会议纪要"|| classifyName == "大事点评"|| classifyName == "年报合集"{
+		if classifyName == "月报" || classifyName == "双周报" || classifyName == "会议纪要" || classifyName == "大事点评" || classifyName == "年报合集" {
 			resp.Type = "报告合集"
 		} else {
 			resp.Type = "专栏详情"

+ 7 - 2
models/response/pc/report.go

@@ -98,12 +98,17 @@ type DetailBannerResp struct {
 	VipTitle           string
 	Author             string
 	ImgUrl             string
+	ClassifyNameFirst  string
+	ClassifyIdFirst    int
 	ClassifyNameSecond string
-	Type string
+	ClassifyIdSecond   int
+	Type               string
 }
 
 type LatestReportBanner struct {
-	ReportId           int       `orm:"column(id)" description:"报告Id" json:"reportId"`
+	ReportId           int `orm:"column(id)" description:"报告Id" json:"reportId"`
+	ClassifyIdFirst    int
+	ClassifyIdSecond   int
 	ClassifyNameFirst  string    `description:"一级分类名称" json:"classify_name_first"`
 	ClassifyNameSecond string    `description:"二级分类名称" json:"classify_name_second"`
 	Title              string    `description:"标题" json:"title"`

+ 3 - 0
models/tables/rddp/report/query.go

@@ -372,6 +372,9 @@ func GetLatestReportByClassifyName(firstName string) (items *pc.LatestReportBann
 	sql := `SELECT
 	a.id AS report_id,
 	classify_name_second,
+	classify_id_second,
+	classify_name_first,
+	classify_id_first,
 	author,
 	stage,
 	vip_title 

+ 1 - 0
models/tables/rddp/report_chapter/query.go

@@ -142,6 +142,7 @@ ORDER BY
 func GetLatestChapterByClassifyName(firstName string) (items *ReportChapter, err error) {
 	sql := `SELECT
 	report_id,
+	classify_name_first,
 	stage 
 FROM
 	report_chapter