Browse Source

fix collect

ziwen 1 year ago
parent
commit
e7374e1073
2 changed files with 4 additions and 0 deletions
  1. 3 0
      controllers/research.go
  2. 1 0
      models/home.go

+ 3 - 0
controllers/research.go

@@ -183,6 +183,9 @@ func (this *MobileResearchController) ArticleNewList() {
 			} else if v.SpecialType == 2 {
 				item.Title = "【观点】" + item.Title
 			}
+			if v.MyCollectNum > 0 {
+				item.IsCollect = true
+			}
 		}
 
 		if item.ArticleTypeName == "纪要" || item.ArticleTypeName == "沙龙" || item.ArticleTypeName == "专家访谈" {

+ 1 - 0
models/home.go

@@ -72,6 +72,7 @@ type ArticleListResp struct {
 	IsCollect           bool     `description:"本人是否收藏"`
 	IsRed               bool     `description:"是否标红"`
 	CollectNum          int      `description:"收藏人数"`
+	MyCollectNum        int      `description:"我收藏的数量"`
 	Resource            int      `description:"来源类型,1:文章、2:产品内测"`
 	Cover               string   `description:"封面图片"`
 	BodyHighlight       []string `description:"搜索高亮展示结果"`