ziwen 1 年之前
父节点
当前提交
2b48eaa41c
共有 5 个文件被更改,包括 14 次插入1 次删除
  1. 5 0
      controllers/user.go
  2. 5 0
      controllers/yanxuan_special.go
  3. 1 1
      models/cygx_yanxuan_special.go
  4. 1 0
      models/report.go
  5. 2 0
      models/user.go

+ 5 - 0
controllers/user.go

@@ -587,6 +587,11 @@ func (this *UserController) CollectList() {
 		if item.ArticleTypeId == -1 {
 			list[i].ArticleTypeName = utils.CYGX_YANXUAN_SPECIAL
 		}
+		if item.SpecialType == 1 {
+			list[i].Title = "【笔记】"+list[i].Title
+		} else if list[i].SpecialType == 2 {
+			list[i].Title = "【观点】"+list[i].Title
+		}
 		if item.MyCollectNum > 0 {
 			list[i].IsCollect = true
 		}

+ 5 - 0
controllers/yanxuan_special.go

@@ -74,6 +74,11 @@ func (this *YanxuanSpecialController) List() {
 			}
 			v.Docs = docs
 		}
+		if v.Type == 1 {
+			v.Title = "【笔记】"+v.Title
+		} else if v.Type == 2 {
+			v.Title = "【观点】"+v.Title
+		}
 		if v.MyCollectNum > 0 {
 			v.IsCollect = 1
 		}

+ 1 - 1
models/cygx_yanxuan_special.go

@@ -42,7 +42,7 @@ type CygxYanxuanSpecialItem struct {
 	BgImg         string // 背景图
 	Reason        string // 理由
 	Title         string // 标题
-	Type          string // 类型1:笔记,2:观点
+	Type          int // 类型1:笔记,2:观点
 	CollectNum    int
 	MyCollectNum  int
 	IsCollect     int

+ 1 - 0
models/report.go

@@ -1065,6 +1065,7 @@ type ArticleReportBillboardResp struct {
 	IsSpecial       int    `description:"是否为研选专栏"`
 	SpecialTags     string `description:"研选专栏标签"`
 	MyCollectNum    int    `description:"本人是否收藏"`
+	SpecialType     int    `description:"专栏类型 1:笔记,2:观点"`
 	List            []*IndustrialManagementIdInt
 }
 

+ 2 - 0
models/user.go

@@ -181,6 +181,7 @@ func GetArticleUserCollectList(startSize, pageSize, userId int) (items []*Articl
 		0 AS pv,
 		0 AS collect_num,
 		0 AS my_collect_num,
+		0 AS special_type,
 		a.create_time AS create_time 
 			FROM cygx_article_collect AS a 
 			INNER JOIN cygx_article as art ON art.article_id = a.article_id
@@ -199,6 +200,7 @@ func GetArticleUserCollectList(startSize, pageSize, userId int) (items []*Articl
 		( SELECT count( 1 ) FROM cygx_yanxuan_special_record AS h WHERE h.yanxuan_special_id = a.id ) AS pv,
 		( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac  INNER JOIN wx_user as u ON  u.user_id = ac.user_id  WHERE ac.yanxuan_special_id = a.id  ) AS collect_num,
 		( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac WHERE ac.yanxuan_special_id = a.id  AND user_id = ? ) AS my_collect_num,
+		a.type AS special_type,
 		c.create_time AS create_time 
 	FROM
 	cygx_yanxuan_special AS a