ziwen 2 سال پیش
والد
کامیت
99568093c1
3فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 2 1
      models/response/classify.go
  2. 1 1
      models/tables/rddp/classify/query.go
  3. 2 1
      services/report/classify.go

+ 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 {

+ 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

+ 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