ziwen 1 年之前
父節點
當前提交
1f9d7b2509
共有 6 個文件被更改,包括 61 次插入47 次删除
  1. 1 0
      controllers/banner.go
  2. 20 10
      controllers/research.go
  3. 17 17
      controllers/user.go
  4. 2 0
      controllers/yanxuan_special.go
  5. 18 18
      models/report.go
  6. 3 2
      utils/constants.go

+ 1 - 0
controllers/banner.go

@@ -221,6 +221,7 @@ func (this *BaseBannerController) ListYx() {
 	listA = []*models.BannerUrlYxResp{
 		&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/web_1.png", Path: "/index/"},
 		&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/web_2.png", Path: ""},
+		&models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/web_4.png", Path: ""},
 	}
 
 	listB = []*models.BannerUrlYxResp{

+ 20 - 10
controllers/research.go

@@ -162,22 +162,32 @@ func (this *MobileResearchController) ArticleNewList() {
 			ArticleTypeName: nameMap[v.ArticleTypeId],
 			ButtonStyle:     styleMap[v.ArticleTypeId],
 			List:            v.List,
-			IsSpecial:       v.IsSpecial,
-			IndustryTags:     strings.Split(v.IndustryTags, ","),
-			CompanyTags:     strings.Split(v.CompanyTags, ","),
 			SpecialColumnId: v.SpecialColumnId,
 		}
-		if v.ArticleTypeId == -1 {
+		if v.IsSpecial == 1 {
+			item.IsSpecial = true
+			item.ImgUrlPc = utils.CYGX_YANXUAN_SPECIAL_IMG_PC
+			if v.CompanyTags != "" {
+				item.CompanyTags = strings.Split(v.CompanyTags, ",")
+			} else {
+				item.CompanyTags = []string{}
+			}
+			if v.IndustryTags != "" {
+				item.IndustryTags = strings.Split(v.IndustryTags, ",")
+			} else {
+				item.IndustryTags = []string{}
+			}
 			item.ArticleTypeName = utils.CYGX_YANXUAN_SPECIAL
+			if v.SpecialType == 1 {
+				item.Title = "【笔记】" + item.Title
+			} else if v.SpecialType == 2 {
+				item.Title = "【观点】" + item.Title
+			}
 		}
-		if v.SpecialType == 1 {
-			item.Title = "【笔记】" + item.Title
-		} else if v.SpecialType == 2 {
-			item.Title = "【观点】" + item.Title
-		}
+
 		if item.ArticleTypeName == "纪要" || item.ArticleTypeName == "沙龙" || item.ArticleTypeName == "专家访谈" {
 			item.Annotation = "核心结论:" + item.Annotation
-		} else {
+		} else if !item.IsSpecial {
 			item.Annotation = "核心观点:" + item.Annotation
 		}
 

+ 17 - 17
controllers/user.go

@@ -927,29 +927,29 @@ func (this *UserController) CollectList() {
 		item := list[i]
 		article := articleMap[item.ArticleId]
 		if list[i].IsSpecial != 1 {
-		list[i].Title = article.Title
-		list[i].DepartmentId = article.DepartmentId
-		list[i].NickName = article.NickName
-		list[i].PublishDate = article.PublishDate
-		if article.ArticleTypeId == 0 {
-			list[i].Source = 1
-		} else {
-			list[i].Source = 2
-			list[i].IsResearch = true
-		}
-				if mapArticleCollectNum[article.ArticleId] != nil {
-			list[i].CollectNum = mapArticleCollectNum[article.ArticleId].CollectNum
-			list[i].Pv = mapArticleCollectNum[article.ArticleId].Pv
-			list[i].IsCollect = mapArticleCollectNum[article.ArticleId].IsCollect
-		}
+			list[i].Title = article.Title
+			list[i].DepartmentId = article.DepartmentId
+			list[i].NickName = article.NickName
+			list[i].PublishDate = article.PublishDate
+			if article.ArticleTypeId == 0 {
+				list[i].Source = 1
+			} else {
+				list[i].Source = 2
+				list[i].IsResearch = true
+			}
+			if mapArticleCollectNum[article.ArticleId] != nil {
+				list[i].CollectNum = mapArticleCollectNum[article.ArticleId].CollectNum
+				list[i].Pv = mapArticleCollectNum[article.ArticleId].Pv
+				list[i].IsCollect = mapArticleCollectNum[article.ArticleId].IsCollect
+			}
 		}
 		if item.ArticleTypeId == -1 {
 			list[i].ArticleTypeName = utils.CYGX_YANXUAN_SPECIAL
 		}
 		if item.SpecialType == 1 {
-			list[i].Title = "【笔记】"+list[i].Title
+			list[i].Title = "【笔记】" + list[i].Title
 		} else if list[i].SpecialType == 2 {
-			list[i].Title = "【观点】"+list[i].Title
+			list[i].Title = "【观点】" + list[i].Title
 		}
 		if item.MyCollectNum > 0 {
 			list[i].IsCollect = true

+ 2 - 0
controllers/yanxuan_special.go

@@ -1097,10 +1097,12 @@ func (this *YanxuanSpecialController) Check() {
 			}
 			if err := res.GetResponseError(); err != nil {
 				// 处理微信返回错误信息
+				br.Msg = "GetResponseError Err:" + err.Error()
 				return
 			}
 			err = os.RemoveAll(savePath)
 			if err != nil {
+				br.Msg = "RemoveAll Err:" + err.Error()
 				return
 			}
 		}

+ 18 - 18
models/report.go

@@ -783,25 +783,25 @@ func GetTimeLineReportIndustrialPublishdateList(industrialIdArr []int) (items []
 
 // 报告榜单start
 type ArticleReportBillboardResp struct {
-	ArticleId      int    `description:"文章id"`
-	Title          string `description:"标题"`
-	PublishDate    string `description:"发布时间"`
-	PermissionName string `description:"行业名称"`
-	DepartmentId   int    `description:"作者Id"`
-	NickName       string `description:"作者昵称"`
-	IsCollect      bool   `description:"本人是否收藏"`
-	Pv             int    `description:"PV"`
-	CollectNum     int    `description:"收藏人数"`
-	Source         int    `description:"来源 1:弘则资源包(报告)、2:研选主题(报告)"`
-	ArticleTypeId  int    `description:"文章类型ID判断是否是研选使用"`
-	IsResearch     bool   `description:"是否属于研选"`
+	ArticleId       int    `description:"文章id"`
+	Title           string `description:"标题"`
+	PublishDate     string `description:"发布时间"`
+	PermissionName  string `description:"行业名称"`
+	DepartmentId    int    `description:"作者Id"`
+	NickName        string `description:"作者昵称"`
+	IsCollect       bool   `description:"本人是否收藏"`
+	Pv              int    `description:"PV"`
+	CollectNum      int    `description:"收藏人数"`
+	Source          int    `description:"来源 1:弘则资源包(报告)、2:研选主题(报告)"`
+	ArticleTypeId   int    `description:"文章类型ID判断是否是研选使用"`
+	IsResearch      bool   `description:"是否属于研选"`
 	ArticleTypeName string `description:"文章类型名称"`
 	IsSpecial       int    `description:"是否为研选专栏"`
 	SpecialTags     string `description:"研选专栏标签"`
 	MyCollectNum    int    `description:"本人是否收藏"`
 	SpecialType     int    `description:"专栏类型 1:笔记,2:观点"`
 	UserId          int    `description:"作者id"`
-	List           []*IndustrialManagementIdInt
+	List            []*IndustrialManagementIdInt
 }
 
 type ArticleReportBillboardLIstPageResp struct {
@@ -832,9 +832,9 @@ type ArticleResearchResp struct {
 	ImgUrlPc        string                       `description:"图片链接"`
 	List            []*IndustrialManagementIdInt `description:"产业列表"`
 	ListSubject     []*IndustrialSubject         `description:"标的列表"`
-	IsSpecial       int                          `description:"是否为研选专栏"`
-	IndustryTags    []string                       `description:"研选专栏行业标签"`
-	CompanyTags     []string                       `description:"研选专栏公司标签"`
+	IsSpecial       bool                         `description:"是否为研选专栏"`
+	IndustryTags    []string                     `description:"研选专栏行业标签"`
+	CompanyTags     []string                     `description:"研选专栏公司标签"`
 	SpecialColumnId int                          `description:"专栏栏目id"`
 }
 
@@ -893,7 +893,7 @@ func GetArticleResearchList(condition string, pars []interface{}, startSize, pag
 		a.id AS article_id,
 		a.title AS title,
 		'' AS body,
-		'' AS annotation,
+		a.content AS annotation,
 		'' AS abstract,
 		a.publish_time AS publish_date,
 		-1 AS article_type_id,
@@ -913,7 +913,7 @@ func GetArticleResearchList(condition string, pars []interface{}, startSize, pag
 	JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
 	WHERE
 	1 = 1  AND a.status = 3 `
-		sql += ` GROUP BY a.article_id ORDER  BY a.publish_date DESC  LIMIT ?,? `
+		sql += ` GROUP BY article_id ORDER  BY publish_date DESC  LIMIT ?,? `
 		_, err = o.Raw(sql, userId, userId, pars, startSize, pageSize).QueryRows(&items)
 	} else {
 		sql += ` GROUP BY a.article_id ORDER  BY a.publish_date DESC  LIMIT ?,? `

+ 3 - 2
utils/constants.go

@@ -225,5 +225,6 @@ const (
 )
 
 const (
-	CYGX_YANXUAN_SPECIAL           = "研选专栏"           //用户阅读数据
-)
+	CYGX_YANXUAN_SPECIAL               = "研选专栏" //用户阅读数据
+	CYGX_YANXUAN_SPECIAL_IMG_PC string = "https://hzstatic.hzinsights.com/cygx/yanxuan_special/special_img_pc.png"
+)