ziwen hace 2 años
padre
commit
a5d70747ab
Se han modificado 2 ficheros con 42 adiciones y 39 borrados
  1. 39 38
      controller/pc/pc.go
  2. 3 1
      models/response/pc/report.go

+ 39 - 38
controller/pc/pc.go

@@ -169,7 +169,7 @@ func ClassifyDetailBanner(c *gin.Context) {
 		resp := &pcModels.DetailBannerResp{
 			ReportId:          chapterItem.ReportId,
 			ClassifyNameFirst: chapterItem.ClassifyNameFirst,
-			ClassifyIdFirst:    chapterItem.ClassifyIdFirst,
+			ClassifyIdFirst:   chapterItem.ClassifyIdFirst,
 			Stage:             chapterItem.Stage,
 			ImgUrl:            "",
 			Type:              "报告合集",
@@ -191,7 +191,7 @@ func ClassifyDetailBanner(c *gin.Context) {
 			return
 		}
 
-		reportItem, err := report.GetLatestReportByClassifyName(classifyName,reportInfo.ClassifyNameSecond)
+		reportItem, err := report.GetLatestReportByClassifyName(classifyName, reportInfo.ClassifyNameSecond)
 		if err != nil {
 			response.Fail("获取报告详情失败"+err.Error(), c)
 			return
@@ -201,6 +201,7 @@ func ClassifyDetailBanner(c *gin.Context) {
 			Stage:              reportItem.Stage,
 			VipTitle:           reportItem.VipTitle,
 			Author:             reportItem.Author,
+			ReportAuthor:       reportItem.ReportAuthor,
 			ImgUrl:             "",
 			ClassifyNameFirst:  reportItem.ClassifyNameFirst,
 			ClassifyIdFirst:    reportItem.ClassifyIdFirst,
@@ -221,9 +222,9 @@ func ClassifyDetailBanner(c *gin.Context) {
 		"双周报": utils.ALIYUN_YBIMG_HOST + "two_week.png",
 		"月报":  utils.ALIYUN_YBIMG_HOST + "month.png",
 
-		"会议纪要":    utils.ALIYUN_YBIMG_HOST + "hyjy.png",
-		"大事点评":    utils.ALIYUN_YBIMG_HOST + "dsdp.png",
-		"年报合集":    utils.ALIYUN_YBIMG_HOST + "nbhj.png",
+		"会议纪要": utils.ALIYUN_YBIMG_HOST + "hyjy.png",
+		"大事点评": utils.ALIYUN_YBIMG_HOST + "dsdp.png",
+		"年报合集": utils.ALIYUN_YBIMG_HOST + "nbhj.png",
 
 		//"草根调研":    utils.ALIYUN_YBIMG_HOST + "hy.png",
 		//"需求报告":    utils.ALIYUN_YBIMG_HOST + "lxt.png",
@@ -283,43 +284,43 @@ func ClassifyDetailBanner(c *gin.Context) {
 	//	"黑色百家谈": utils.ALIYUN_YBIMG_HOST + "wxy.png",
 	//}
 	authorMap := map[string]string{
-		"白昕":     utils.ALIYUN_YBIMG_HOST + "bx.png",
-		"曹阳":     utils.ALIYUN_YBIMG_HOST + "cy.png",
-		"曾硕":     utils.ALIYUN_YBIMG_HOST + "zs.png",
-		"曾滢月":     utils.ALIYUN_YBIMG_HOST + "zyy.png",
-		"程品":     utils.ALIYUN_YBIMG_HOST + "cp.png",
-		"高雯宇":     utils.ALIYUN_YBIMG_HOST + "gwy.png",
-		"高昕":     utils.ALIYUN_YBIMG_HOST + "gx.png",
-		"高吟":     utils.ALIYUN_YBIMG_HOST + "gy.png",
-		"陈聪聪":     utils.ALIYUN_YBIMG_HOST + "ccc.png",
-		"何凯":     utils.ALIYUN_YBIMG_HOST + "hk.png",
-		"黄鑫":     utils.ALIYUN_YBIMG_HOST + "hx.png",
-		"黄逸赟":     utils.ALIYUN_YBIMG_HOST + "hyy.png",
-		"黄溢":     utils.ALIYUN_YBIMG_HOST + "hy.png",
-		"李灵":     utils.ALIYUN_YBIMG_HOST + "ll.png",
-		"林秋馨":     utils.ALIYUN_YBIMG_HOST + "lqx.png",
-		"刘鼎邦":     utils.ALIYUN_YBIMG_HOST + "ldb.png",
-		"钱鹏":     utils.ALIYUN_YBIMG_HOST + "qp.png",
-		"刘艺羡":     utils.ALIYUN_YBIMG_HOST + "lyx.png",
-		"戚明之":     utils.ALIYUN_YBIMG_HOST + "qmz.png",
-		"秦钏":     utils.ALIYUN_YBIMG_HOST + "qc.png",
-		"施琪":     utils.ALIYUN_YBIMG_HOST + "sq.png",
-		"王存响":     utils.ALIYUN_YBIMG_HOST + "wcx.png",
-		"王沛":     utils.ALIYUN_YBIMG_HOST + "wp.png",
-		"苏畅":     utils.ALIYUN_YBIMG_HOST + "sc.png",
-		"史瑾璇":     utils.ALIYUN_YBIMG_HOST + "sjx.png",
-		"王亚丹":     utils.ALIYUN_YBIMG_HOST + "wyd.png",
-		"虞风":     utils.ALIYUN_YBIMG_HOST + "yf.png",
-		"魏忻悦":     utils.ALIYUN_YBIMG_HOST + "wxy.png",
-		"王艺滢":     utils.ALIYUN_YBIMG_HOST + "wyy.png",
-		"姚昕泽":     utils.ALIYUN_YBIMG_HOST + "yxz.png",
-		"章左昊":     utils.ALIYUN_YBIMG_HOST + "zzh.png",
-		"李晓瞳":     utils.ALIYUN_YBIMG_HOST + "lxt.png",
+		"白昕":  utils.ALIYUN_YBIMG_HOST + "bx.png",
+		"曹阳":  utils.ALIYUN_YBIMG_HOST + "cy.png",
+		"曾硕":  utils.ALIYUN_YBIMG_HOST + "zs.png",
+		"曾滢月": utils.ALIYUN_YBIMG_HOST + "zyy.png",
+		"程品":  utils.ALIYUN_YBIMG_HOST + "cp.png",
+		"高雯宇": utils.ALIYUN_YBIMG_HOST + "gwy.png",
+		"高昕":  utils.ALIYUN_YBIMG_HOST + "gx.png",
+		"高吟":  utils.ALIYUN_YBIMG_HOST + "gy.png",
+		"陈聪聪": utils.ALIYUN_YBIMG_HOST + "ccc.png",
+		"何凯":  utils.ALIYUN_YBIMG_HOST + "hk.png",
+		"黄鑫":  utils.ALIYUN_YBIMG_HOST + "hx.png",
+		"黄逸赟": utils.ALIYUN_YBIMG_HOST + "hyy.png",
+		"黄溢":  utils.ALIYUN_YBIMG_HOST + "hy.png",
+		"李灵":  utils.ALIYUN_YBIMG_HOST + "ll.png",
+		"林秋馨": utils.ALIYUN_YBIMG_HOST + "lqx.png",
+		"刘鼎邦": utils.ALIYUN_YBIMG_HOST + "ldb.png",
+		"钱鹏":  utils.ALIYUN_YBIMG_HOST + "qp.png",
+		"刘艺羡": utils.ALIYUN_YBIMG_HOST + "lyx.png",
+		"戚明之": utils.ALIYUN_YBIMG_HOST + "qmz.png",
+		"秦钏":  utils.ALIYUN_YBIMG_HOST + "qc.png",
+		"施琪":  utils.ALIYUN_YBIMG_HOST + "sq.png",
+		"王存响": utils.ALIYUN_YBIMG_HOST + "wcx.png",
+		"王沛":  utils.ALIYUN_YBIMG_HOST + "wp.png",
+		"苏畅":  utils.ALIYUN_YBIMG_HOST + "sc.png",
+		"史瑾璇": utils.ALIYUN_YBIMG_HOST + "sjx.png",
+		"王亚丹": utils.ALIYUN_YBIMG_HOST + "wyd.png",
+		"虞风":  utils.ALIYUN_YBIMG_HOST + "yf.png",
+		"魏忻悦": utils.ALIYUN_YBIMG_HOST + "wxy.png",
+		"王艺滢": utils.ALIYUN_YBIMG_HOST + "wyy.png",
+		"姚昕泽": utils.ALIYUN_YBIMG_HOST + "yxz.png",
+		"章左昊": utils.ALIYUN_YBIMG_HOST + "zzh.png",
+		"李晓瞳": utils.ALIYUN_YBIMG_HOST + "lxt.png",
 	}
 
 	if url, ok := firstNameMap[bannerResp.ClassifyNameFirst]; ok {
 		bannerResp.ImgUrl = url
-	} else if url, ok := authorMap[bannerResp.Author]; ok {
+	} else if url, ok = authorMap[bannerResp.ReportAuthor]; ok {
 		bannerResp.ImgUrl = url
 	}
 	response.OkData("查询成功", bannerResp, c)

+ 3 - 1
models/response/pc/report.go

@@ -57,7 +57,7 @@ type LatestReport struct {
 	Id                 int       `orm:"column(id)" description:"报告Id" json:"_"`
 	ClassifyNameFirst  string    `description:"一级分类名称" json:"classify_name_first"`
 	ClassifyNameSecond string    `description:"二级分类名称" json:"classify_name_second"`
-	ClassifyIdSecond   int    `description:"二级分类id" json:"classify_id_second"`
+	ClassifyIdSecond   int       `description:"二级分类id" json:"classify_id_second"`
 	Title              string    `description:"标题" json:"title"`
 	State              int       `description:"1:未发布,2:已发布" json:"state"`
 	PublishTime        time.Time `description:"发布时间" json:"publish_time"`
@@ -98,6 +98,7 @@ type DetailBannerResp struct {
 	Stage              int
 	VipTitle           string
 	Author             string
+	ReportAuthor       string
 	ImgUrl             string
 	ClassifyNameFirst  string
 	ClassifyIdFirst    int
@@ -118,4 +119,5 @@ type LatestReportBanner struct {
 	Stage              int       `description:"期数" json:"stage"`
 	VipTitle           string
 	Author             string
+	ReportAuthor       string
 }