Sfoglia il codice sorgente

fix:章节类型报告详情

Roc 8 mesi fa
parent
commit
3a63863ed7

+ 2 - 0
models/response/report.go

@@ -91,6 +91,7 @@ type ReportChapterItem struct {
 	CanvasColor           string    `description:"画布颜色" json:"canvas_color"`
 	HeadStyle             string    `description:"版头样式" json:"head_style"`
 	EndStyle              string    `description:"版尾样式" json:"end_style"`
+	ReportVideoUrl        string    `description:"报告音频" json:"report_video_url"`
 }
 
 type ReportChapterDetail struct {
@@ -129,6 +130,7 @@ type ReportListItem struct {
 	AuthOk             bool             `json:"auth_ok"`
 	TitleInfo          string           `json:"title_info"`
 	HasChapter         int              `description:"是否有章节" json:"has_chapter"`
+	VideoUrl           string           `description:"报告音频" json:"video_url"`
 }
 
 type VideoListItem struct {

+ 1 - 0
models/tables/rddp/classify/classify.go

@@ -32,6 +32,7 @@ type Classify struct {
 	YbListImg         string    `gorm:"column:yb_list_img" db:"yb_list_img" json:"yb_list_img" form:"yb_list_img"`                             //研报小程序端报告列表封面图
 	YbShareBgImg      string    `gorm:"column:yb_share_bg_img;" db:"yb_share_bg_img" json:"yb_share_bg_img" form:"yb_share_bg_img"`
 	YbRightBanner     string    `gorm:"column:yb_right_banner;" db:"yb_right_banner" json:"yb_right_banner" form:"yb_right_banner"` // 研报小程序-报告分享背景图
+	HasChild          int       `gorm:"column:has_child" db:"has_child" json:"has_child" form:"has_child"`                          //是否有子级别,0:下面没有子分类,1:下面有子分类;默认:0
 }
 
 func (c *Classify) TableName() string {

+ 2 - 1
services/report/report.go

@@ -742,7 +742,7 @@ func GetReportList(user user.UserInfo, keyWord string, classifyIdFirst, classify
 		//}
 
 	} else {
-		if classifyParent.ClassifyName == "晨报" || classifyParent.ClassifyName == "周报" {
+		if classifyParent.HasChild == 0 {
 			//reportImgUrl = chartPermissionImageMap[1]
 			classifyIdSeconds = append(classifyIdSeconds, 0)
 		}
@@ -958,6 +958,7 @@ func GetReportList(user user.UserInfo, keyWord string, classifyIdFirst, classify
 			reportItem := new(response.ReportListItem)
 			reportItem.ReportId = reportInfo.Id
 			reportItem.HasChapter = reportInfo.HasChapter
+			reportItem.VideoUrl = reportInfo.VideoUrl
 			// 样式限制行数
 			reportItem.Title = "<div style=\"-webkit-line-clamp: 2;-webkit-box-orient: vertical;display: -webkit-box;overflow: hidden;text-overflow: ellipsis;\">" + reportInfo.Title + "</div>"
 			reportItem.PublishTime = reportInfo.PublishTime

+ 1 - 0
services/report/report_chapter.go

@@ -258,6 +258,7 @@ func GetChapterDetail(user user.UserInfo, reportChapterId int) (reportChapterDet
 	reportChapterItem.HeadImg = reportInfo.HeadImg
 	reportChapterItem.EndImg = reportInfo.EndImg
 	reportChapterItem.CanvasColor = reportInfo.CanvasColor
+	reportChapterItem.ReportVideoUrl = reportInfo.VideoUrl
 
 	// 版头版尾样式
 	{

+ 1 - 3
services/report/report_view_record.go

@@ -31,9 +31,7 @@ func AddViewRecord(userInfo user.UserInfo, reportId int, classifyName string, re
 	record.RealName = userInfo.RealName
 	record.CompanyName = companyInfo.CompanyName
 	record.CreateTime = time.Now()
-	if classifyName == "晨报" || classifyName == "周报" {
-		record.ReportChapterId = reportChapterId
-	}
+	record.ReportChapterId = reportChapterId
 	err = report_view_record.Create(record)
 	if err != nil {
 		return

+ 1 - 1
services/yb_common.go

@@ -99,7 +99,7 @@ func CheckReportExistByReportIdReportChapterId(reportId, reportChapterId int) (e
 		return
 	}
 
-	if (reportInfo.ClassifyNameFirst == "晨报" || reportInfo.ClassifyNameFirst == "周报") && reportChapterId <= 0 {
+	if reportInfo.HasChapter == 1 && reportChapterId <= 0 {
 		err = errors.New("请输入报告章节ID")
 		return
 	}