|
@@ -273,7 +273,6 @@ func (er *EnglishReportController) FilterByEs(c *gin.Context) {
|
|
|
reportItem.ContentSub = v.Highlight["BodyContent"][0]
|
|
|
}
|
|
|
reportItem.ContentSub = "<div style=\"-webkit-line-clamp: 3;-webkit-box-orient: vertical;display: -webkit-box;overflow: hidden;text-overflow: ellipsis;\">" + reportItem.ContentSub + "</div>"
|
|
|
-
|
|
|
}
|
|
|
tempList = append(tempList, reportItem)
|
|
|
}
|
|
@@ -281,13 +280,28 @@ func (er *EnglishReportController) FilterByEs(c *gin.Context) {
|
|
|
videoIds := make([]uint, 0)
|
|
|
videoMap := make(map[uint]*english_video.EnglishVideo)
|
|
|
videoItem := new(english_video.EnglishVideo)
|
|
|
+ var classifyThirdIds []int
|
|
|
if len(tempList) > 0 {
|
|
|
for _, reportItem := range tempList {
|
|
|
if reportItem.VideoId > 0 {
|
|
|
videoIds = append(videoIds, reportItem.VideoId)
|
|
|
}
|
|
|
+ classifyThirdIds = append(classifyThirdIds, reportItem.ClassifyIdSecond)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ enClassify := new(english_classify.Classify)
|
|
|
+ //查询分类详情
|
|
|
+ nameList, err := enClassify.GetEnglishClassifyFullNameByIds(classifyThirdIds)
|
|
|
+ if err != nil {
|
|
|
+ resp.FailMsg("获取分类失败", "获取分类信息失败,Err:"+err.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ classifyMap := make(map[int]*english_classify.EnglishClassifyFullName)
|
|
|
+ for _, v := range nameList {
|
|
|
+ classifyMap[v.Id] = v
|
|
|
+ }
|
|
|
+
|
|
|
if len(videoIds) > 0 {
|
|
|
videoList, e := videoItem.GetVideosByIds(videoIds)
|
|
|
if e != nil {
|
|
@@ -307,6 +321,10 @@ func (er *EnglishReportController) FilterByEs(c *gin.Context) {
|
|
|
temp.ContentSub = reportItem.ContentSub
|
|
|
temp.PublishTime = reportItem.PublishTime
|
|
|
temp.ReportCode = reportItem.ReportCode
|
|
|
+ classifyInfo := new(english_classify.EnglishClassifyFullName)
|
|
|
+ if cv, ok := classifyMap[reportItem.ClassifyIdSecond]; ok {
|
|
|
+ classifyInfo = cv
|
|
|
+ }
|
|
|
if reportItem.ReportId > 0 {
|
|
|
temp.Id = reportItem.ReportId
|
|
|
temp.ClassifyIdFirst = reportItem.ClassifyIdFirst
|
|
@@ -314,6 +332,8 @@ func (er *EnglishReportController) FilterByEs(c *gin.Context) {
|
|
|
temp.ClassifyIdSecond = reportItem.ClassifyIdSecond
|
|
|
temp.ClassifyNameSecond = reportItem.ClassifyNameSecond
|
|
|
temp.Stage, _ = strconv.Atoi(reportItem.StageStr)
|
|
|
+ temp.ClassifyIdRoot = classifyInfo.RootId
|
|
|
+ temp.ClassifyNameRoot = classifyInfo.RootName
|
|
|
} else if reportItem.VideoId > 0 {
|
|
|
if videoTemp, ok := videoMap[reportItem.VideoId]; ok {
|
|
|
temp.ReportType = 1
|
|
@@ -325,6 +345,8 @@ func (er *EnglishReportController) FilterByEs(c *gin.Context) {
|
|
|
temp.VideoUrl = videoTemp.VideoUrl
|
|
|
temp.VideoCoverUrl = videoTemp.VideoCoverUrl
|
|
|
temp.VideoSeconds = videoTemp.VideoSeconds
|
|
|
+ temp.ClassifyIdRoot = classifyInfo.RootId
|
|
|
+ temp.ClassifyNameRoot = classifyInfo.RootName
|
|
|
}
|
|
|
}
|
|
|
reportList = append(reportList, temp)
|
|
@@ -376,6 +398,17 @@ func (er *EnglishReportController) Detail(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ // 查询分类
|
|
|
+ classifyItem := new(english_classify.Classify)
|
|
|
+ fullClassify := new(english_classify.EnglishClassifyFullName)
|
|
|
+ fullClassifyList, err := classifyItem.GetEnglishClassifyFullNameByIds([]int{reportItem.ClassifyIdSecond})
|
|
|
+ if err != nil {
|
|
|
+ resp.FailMsg("查询分类信息失败", "查询分类信息失败,Err:"+err.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if len(fullClassifyList) > 0 {
|
|
|
+ fullClassify = fullClassifyList[0]
|
|
|
+ }
|
|
|
// 记录邮箱
|
|
|
shareEmailId := userinfo.Id
|
|
|
if shareEmailId > 0 {
|
|
@@ -405,6 +438,8 @@ func (er *EnglishReportController) Detail(c *gin.Context) {
|
|
|
CreateTime: utils.TimeTransferString(utils.FormatDateTime, reportItem.CreateTime),
|
|
|
ModifyTime: utils.TimeTransferString(utils.FormatDateTime, reportItem.ModifyTime),
|
|
|
KeyTakeaways: reportItem.KeyTakeaways,
|
|
|
+ ClassifyIdRoot: fullClassify.RootId,
|
|
|
+ ClassifyNameRoot: fullClassify.RootName,
|
|
|
}
|
|
|
baseData := new(english_report.ReportDetailResp)
|
|
|
baseData.Report = reportDetail
|