ziwen 2 anni fa
parent
commit
ad30f38736

+ 12 - 0
controller/pc/pc.go

@@ -12,6 +12,18 @@ import (
 	"strconv"
 )
 
+// LatestNews 研报首页最新资讯
+func LatestNews(c *gin.Context)  {
+	banner,err := banner.GetHomeBannerList()
+	if err != nil {
+		response.Fail(err.Error(), c)
+		return
+	}
+	response.OkData("查询成功", banner, c )
+	return
+}
+
+
 // Banner 首页banner图
 func Banner(c *gin.Context)  {
 	banner,err := banner.GetHomeBannerList()

+ 1 - 0
models/response/report.go

@@ -47,6 +47,7 @@ type ReportChapterItem struct {
 	ReportChapterId    int    `json:"report_chapter_id"`
 	ReportId        int    `json:"report_id"`
 	Title           string    `json:"title"`
+	Abstract string `json:"abstract"`
 	TypeId                  int         `json:"type_id"`
 	TypeName                string         	`json:"type_name"`
 	Trend                   string      `json:"trend"`

+ 1 - 1
models/tables/rddp/report_chapter/query.go

@@ -58,7 +58,7 @@ func GetListByReportIdTypeIds(reportId int, typeIds []int, classifyNameFirst str
 
 // GetContentById 根据ID获取章节详情
 func GetContentById(id int, typeIds []int) (info *ReportChapter, err error)  {
-	err = global.MYSQL["rddp"].Model(ReportChapter{}).Select("report_chapter_id, report_id,  is_edit, classify_name_first, classify_id_first, content, trend, type_id, type_name, abstract, title, author, stage, publish_time, content, content_sub, video_url, video_name, video_play_seconds, video_size").
+	err = global.MYSQL["rddp"].Model(ReportChapter{}).Select("report_chapter_id, report_id,  is_edit, classify_name_first, classify_id_first, content, trend, type_id, type_name, abstract, title, abstract, author, stage, publish_time, content, content_sub, video_url, video_name, video_play_seconds, video_size").
 		Where("report_chapter_id = ? and type_id in (?) AND publish_state = 2 ", id, typeIds).
 		First(&info).Error
 	if err == utils.ErrNoRow {

+ 1 - 0
routers/pc.go

@@ -8,6 +8,7 @@ import (
 
 func InitPc(r *gin.Engine)  {
 	rGroup := r.Group("pc").Use(middleware.Token())
+	rGroup.GET("/latest_news", pc.Banner)
 	rGroup.GET("/banner", pc.Banner)
 	rGroup.GET("/latest_release", pc.LatestRelease)
 	rGroup.GET("/detail", pc.ClassifyDetail)

+ 1 - 1
services/report/report_chapter.go

@@ -237,7 +237,7 @@ func GetChapterDetail(user user.UserInfo, reportChapterId int) (reportChapterDet
 	reportChapterItem := new(response.ReportChapterItem)
 	reportChapterItem.ReportChapterId = reportChapter.ReportChapterId
 	reportChapterItem.ReportId = reportChapter.ReportId
-
+	reportChapterItem.Abstract = reportChapter.Abstract
 	reportChapterItem.TypeId = reportChapter.TypeId
 	reportChapterItem.Title = reportChapter.Title
 	reportChapterItem.ReportId = reportChapter.ReportId