|
@@ -433,9 +433,19 @@ func GetReportDetail(userinfo user.UserInfo, reportId int) (reportDetail respons
|
|
|
reportItem.VideoSize = reportInfo.VideoSize
|
|
|
reportItem.VideoPlaySeconds = reportInfo.VideoPlaySeconds
|
|
|
reportItem.Author = reportInfo.Author
|
|
|
+ // 分享背景图取二级分类配图, 二级没有配图时使用一级配图, 一级也没有使用默认图
|
|
|
reportItem.ShareBgImg = utils.DEFAULT_REPORT_SHARE_BG_IMG
|
|
|
- if firstClassify.YbShareBgImg != "" {
|
|
|
- reportItem.ShareBgImg = firstClassify.YbShareBgImg
|
|
|
+ secondClassify, e := classify.GetByClassifyId(reportInfo.ClassifyIdSecond)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("报告二级分类有误")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if secondClassify.YbShareBgImg != "" {
|
|
|
+ reportItem.ShareBgImg = secondClassify.YbShareBgImg
|
|
|
+ } else {
|
|
|
+ if firstClassify.YbShareBgImg != "" {
|
|
|
+ reportItem.ShareBgImg = firstClassify.YbShareBgImg
|
|
|
+ }
|
|
|
}
|
|
|
var reportTypeList []*response.ReportChapterListItem
|
|
|
|