|
@@ -4,7 +4,6 @@ import (
|
|
|
"fmt"
|
|
|
"hongze/hongze_yb/models/response/purchase"
|
|
|
"hongze/hongze_yb/models/tables/chart_permission_chapter_mapping"
|
|
|
- "hongze/hongze_yb/models/tables/rddp/classify"
|
|
|
"hongze/hongze_yb/models/tables/rddp/report"
|
|
|
"hongze/hongze_yb/models/tables/rddp/report_chapter"
|
|
|
"hongze/hongze_yb/models/tables/rddp/report_view_log"
|
|
@@ -143,16 +142,6 @@ func GetPurchaseDetail(permissionIds []int, userId uint64, classifyNameFirst str
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- //获取所有分类
|
|
|
- classifys, tErr := classify.GetAll()
|
|
|
- if tErr != nil {
|
|
|
- err = tErr
|
|
|
- return
|
|
|
- }
|
|
|
- classMap := make(map[int]string)
|
|
|
- for _, v := range classifys {
|
|
|
- classMap[v.Id] = v.ReportImgUrl
|
|
|
- }
|
|
|
//查询有效的章节
|
|
|
var chapter *report_chapter.ReportChapter
|
|
|
typeIds, tErr := report_chapter_type.GetEffectTypeID()
|
|
@@ -171,7 +160,6 @@ func GetPurchaseDetail(permissionIds []int, userId uint64, classifyNameFirst str
|
|
|
temp.Title = v.Title
|
|
|
temp.ClassifyIdSecond = v.ClassifyIdSecond
|
|
|
temp.ClassifyNameSecond = v.ClassifyNameSecond
|
|
|
- temp.ReportImgUrl, _ = classMap[temp.ClassifyIdFirst]
|
|
|
if temp.ClassifyNameFirst == "晨报" || temp.ClassifyNameFirst == "周报" { //晨报或者周报,查询最新的章节信息
|
|
|
if len(typeIds) <= 0 {
|
|
|
continue
|
|
@@ -181,15 +169,18 @@ func GetPurchaseDetail(permissionIds []int, userId uint64, classifyNameFirst str
|
|
|
return
|
|
|
}
|
|
|
temp.Content = fmt.Sprintf("【第%d期|FICC|%s】%s", temp.Stage, chapter.TypeName, temp.Title)
|
|
|
+ temp.TopName = temp.Title
|
|
|
}else{
|
|
|
if temp.ClassifyIdSecond > 0 { //包含二级分类
|
|
|
temp.Content = fmt.Sprintf("【第%d期|FICC| %s】%s", temp.Stage, temp.ClassifyNameSecond, temp.ClassifyNameFirst)
|
|
|
- temp.ReportImgUrl, _ = classMap[temp.ClassifyIdSecond]
|
|
|
+ temp.TopName = temp.ClassifyNameSecond
|
|
|
} else { //无二级分类
|
|
|
temp.Content = fmt.Sprintf("【第%d期|FICC】%s", temp.Stage, temp.ClassifyNameFirst)
|
|
|
+ temp.TopName = temp.ClassifyNameFirst
|
|
|
}
|
|
|
}
|
|
|
temp.Time = v.PublishTime
|
|
|
+
|
|
|
list = append(list, temp)
|
|
|
}
|
|
|
}
|