Browse Source

Merge branch 'yb_pc2.0' into debug

# Conflicts:
#	models/response/report.go
#	models/tables/rddp/report_chapter/query.go
ziwen 2 years ago
parent
commit
6a3106698c

+ 1 - 1
controller/pc/pc.go

@@ -315,7 +315,7 @@ func ClassifyDetailBanner(c *gin.Context) {
 		"王艺滢": utils.ALIYUN_YBIMG_HOST + "wyy.png",
 		"姚昕泽": utils.ALIYUN_YBIMG_HOST + "yxz.png",
 		"章左昊": utils.ALIYUN_YBIMG_HOST + "zzh.png",
-		"李晓": utils.ALIYUN_YBIMG_HOST + "lxt.png",
+		"李晓": utils.ALIYUN_YBIMG_HOST + "lxt.png",
 		"弘则FICC无锡调研团队": utils.ALIYUN_YBIMG_HOST + "qp.png",
 		"弘则能化组": utils.ALIYUN_YBIMG_HOST + "qmz.png",
 		"弘则有色团队": utils.ALIYUN_YBIMG_HOST + "qp.png",

+ 2 - 1
models/response/classify.go

@@ -7,13 +7,14 @@ import (
 type ClassifyListItem struct {
 	ClassifyIdSecond   int    `json:"classify_id_second"`
 	ClassifyNameSecond string `json:"classify_name_second"`
+	Abstract           string `json:"abstract"`
 	ParentId           int    `json:"parent_id"`
 	ReportAuthor       string `json:"report_author"`
 	AuthorDescript     string `json:"author_descript"`
 	HomeImgUrl         string `json:"home_img_url"`
 	Stage              int    `description:"期数" json:"stage"`
 	ProductName        string `json:"product_name"`
-	VipTitle		   string `json:"vip_title"`
+	VipTitle           string `json:"vip_title"`
 }
 
 type ClassifyDetail struct {

+ 0 - 4
models/response/report.go

@@ -9,8 +9,6 @@ type ReportDetail struct {
 	ReportChapterList []*ReportChapterListItem `json:"report_chapter_list"`
 	PermissionCheck   *PermissionCheckInfo     `json:"permission_check"`
 	AuthOk            bool                     `json:"auth_ok"`
-	LikeNum           int64                    `description:"点赞总数" json:"like_num"`
-	LikeEnabled       int8                     `description:"是否已点赞: 0-未点赞 1-已点赞" json:"like_enabled"`
 }
 
 type ReportChapterListItem struct {
@@ -75,8 +73,6 @@ type ReportChapterDetail struct {
 	PermissionCheck        *PermissionCheckInfo    `json:"permission_check"`
 	ReportChapterMenuList  []*ReportChapterMenu    `json:"report_chapter_menu_list"`
 	AuthOk                 bool                    `json:"auth_ok"`
-	LikeNum                int64  `description:"点赞总数" json:"like_num"`
-	LikeEnabled            int8 `description:"是否已点赞: 0-未点赞 1-已点赞" json:"like_enabled"`
 }
 
 type ReportChapterMenu struct {

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

@@ -58,7 +58,7 @@ func GetByClassifyId(id int) (item *Classify, err error) {
 // GetListByPid 根据分类名称查找专栏列表
 func GetListByPid(pid int) (list []*Classify, err error) {
 	err = global.MYSQL["rddp"].Model(Classify{}).
-		Select("id, classify_name, parent_id, report_author, author_descript, home_img_url, vip_title, avatar_img_url").
+		Select("id, classify_name, parent_id, abstract, report_author, author_descript, home_img_url, vip_title, avatar_img_url").
 		Where("parent_id = ? AND is_show = 1 ", pid).Order("sort asc, id asc").Scan(&list).Error
 	if err == utils.ErrNoRow {
 		err = nil

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

@@ -59,7 +59,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, abstract, author, stage, publish_time, content, content_sub, video_url, video_name, video_play_seconds, video_size, report_type").
+	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, report_type, video_size").
 		Where("report_chapter_id = ? and type_id in (?) AND publish_state = 2 ", id, typeIds).
 		First(&info).Error
 	if err == utils.ErrNoRow {

+ 2 - 1
services/report/classify.go

@@ -70,6 +70,7 @@ func GetClassListByClassifyId(user user.UserInfo, classifyIdFirst int) (list []*
 		temp.ClassifyIdSecond = item.Id
 		temp.ParentId = item.ParentId
 		temp.AuthorDescript = item.AuthorDescript
+		temp.Abstract = item.Abstract
 		temp.ReportAuthor = item.ReportAuthor
 		temp.HomeImgUrl = item.AvatarImgUrl	// 此处图片用二级分类的"头像"
 		temp.ClassifyNameSecond = item.ClassifyName
@@ -231,7 +232,7 @@ func GetClassifyReportList(user user.UserInfo, classifyIdSecond int, pageIndex,
 			if reportInfo.Abstract != "" {
 				reportItem.Abstract = "<div style=\"overflow: hidden;white-space: nowrap;text-overflow: ellipsis;\">" +reportInfo.Abstract+"</div>"
 			}
-			reportItem.Author = reportInfo.Author
+			reportItem.Author = classifyInfo.ReportAuthor
 			reportItem.ReportImgUrl = classifyInfo.AvatarImgUrl	// 此处图片用二级分类的"头像"
 			reportItem.VideoName = reportInfo.VideoName
 			reportItem.VideoPlaySeconds = reportInfo.VideoPlaySeconds