Эх сурвалжийг харах

海通国际对接策略平台详情跳转

xingzai 2 жил өмнө
parent
commit
3202fcc818

+ 5 - 0
controllers/article.go

@@ -1175,6 +1175,11 @@ func (this *ArticleCommonController) DetailPublic() {
 			utils.Rc.Put(key, 1, 5*time.Second)
 			models.ModifyReportLastViewTime(wxUser.UserId)
 		}
+		if detail.ArticleId < utils.SummaryArticleId {
+			chartUserTokenByMobile, _ := services.GetUserTokenByMobile(utils.HtgjPublicMobile)
+			detail.HttpUrl = utils.StrategyPlatform + strconv.Itoa(articleId) + "?token=" + chartUserTokenByMobile
+			detail.IsNeedJump = true
+		}
 	}
 	resp.CompanyName = companyName
 	br.Ret = 200

+ 15 - 11
controllers/home.go

@@ -255,7 +255,7 @@ func (this *BaseHomeController) ListHomePublic() {
 			br.ErrMsg = "获取信息失败,Err:" + err.Error()
 			return
 		}
-		if userType == 1 && categoryinfo.PermissionName == "研选" {
+		if userType == 1 && strings.Contains(categoryinfo.PermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
 			resp.HaveResearch = false
 			resp.Paging = page
 			br.Ret = 200
@@ -267,14 +267,14 @@ func (this *BaseHomeController) ListHomePublic() {
 		page = paging.GetPaging(currentIndex, pageSize, total)
 		if categoryId != "" {
 			condition += ` AND category_id IN(` + categoryId + `)`
-			condition += ` OR ( category_name  LIKE '%` + categoryinfo.PermissionName + `%' AND publish_status = 1 AND is_summary = 1 )`
+			condition += ` OR ( category_name  LIKE '%` + utils.CHART_PERMISSION_NAME_YANXUAN + `%' AND publish_status = 1 AND is_summary = 1 )`
 		} else {
-			condition += ` AND  category_name   LIKE '%` + categoryinfo.PermissionName + `%'`
+			condition += ` AND  category_name   LIKE '%` + utils.CHART_PERMISSION_NAME_YANXUAN + `%'`
 		}
 	}
 	//永续客户无法查看研选分类的内容
 	if userType == 1 {
-		condition += ` AND  category_name  NOT LIKE '%研选` + `%'`
+		condition += ` AND  category_name  NOT LIKE '%` + utils.CHART_PERMISSION_NAME_YANXUAN + `%'`
 	}
 	total, err = models.GetHomeCount(condition, pars)
 	if err != nil {
@@ -289,7 +289,7 @@ func (this *BaseHomeController) ListHomePublic() {
 		br.Msg = "获取帖子数据失败,Err:" + err.Error()
 		return
 	}
-	for k, _ := range list {
+	for k, v := range list {
 		item := list[k]
 		//如果文章一开始的内容是图片,优先展示第一张图片
 		imgurl, _ := services.FixArticleImgUrl(html.UnescapeString(list[k].Body))
@@ -299,9 +299,13 @@ func (this *BaseHomeController) ListHomePublic() {
 			list[k].BodyHtml = imgurl
 		}
 		list[k].PublishDate = utils.StrTimeToTime(item.PublishDate).Format(utils.FormatDateTimeNoSecond) //时间字符串格式转时间格式
-		if strings.Contains(item.CategoryName, "研选") {
+		if strings.Contains(item.CategoryName, utils.CHART_PERMISSION_NAME_YANXUAN) {
 			list[k].IsResearch = true
 		}
+		if list[k].ArticleId < utils.SummaryArticleId {
+			list[k].HttpUrl = utils.StrategyPlatform + strconv.Itoa(v.ArticleId)
+			list[k].IsNeedJump = true
+		}
 		if item.Pv > 999 {
 			list[k].Pv = 999
 		}
@@ -448,7 +452,7 @@ func (this *HomeController) ListHomeArtAndChart() {
 				br.ErrMsg = "获取信息失败,Err:" + err.Error()
 				return
 			}
-			if userType == 1 && categoryinfo.PermissionName == "研选" {
+			if userType == 1 && strings.Contains(categoryinfo.PermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
 				resp.HaveResearch = false
 				resp.Paging = page
 				br.Ret = 200
@@ -460,14 +464,14 @@ func (this *HomeController) ListHomeArtAndChart() {
 			page = paging.GetPaging(currentIndex, pageSize, total)
 			if categoryId != "" {
 				condition += ` AND category_id IN(` + categoryId + `)`
-				condition += ` OR ( category_name  LIKE '%研选` + `%' AND publish_status = 1 AND is_summary = 1 )`
+				condition += ` OR ( category_name  LIKE '%` + utils.CHART_PERMISSION_NAME_YANXUAN + `%' AND publish_status = 1 AND is_summary = 1 )`
 			} else {
-				condition += ` AND  category_name   LIKE '%研选` + `%'`
+				condition += ` AND  category_name   LIKE '%` + utils.CHART_PERMISSION_NAME_YANXUAN + `%'`
 			}
 		}
 		//永续客户无法查看研选分类的内容
 		if userType == 1 {
-			condition += ` AND  category_name  NOT LIKE '%研选` + `%'`
+			condition += ` AND  category_name  NOT LIKE '%` + utils.CHART_PERMISSION_NAME_YANXUAN + `%'`
 		}
 		total, err = models.GetHomeCount(condition, pars)
 		if err != nil {
@@ -518,7 +522,7 @@ func (this *HomeController) ListHomeArtAndChart() {
 				list[k].BodyHtml = imgurl
 			}
 			list[k].PublishDate = utils.StrTimeToTime(item.PublishDate).Format(utils.FormatDateTimeNoSecond) //时间字符串格式转时间格式
-			if strings.Contains(item.CategoryName, "研选") {
+			if strings.Contains(item.CategoryName, utils.CHART_PERMISSION_NAME_YANXUAN) {
 				list[k].IsResearch = true
 			}
 			if item.Pv > 999 {

+ 2 - 0
utils/config.go

@@ -69,6 +69,7 @@ var (
 	HtgjDefaultSaleName       string //海通默认销售名称
 	HtgjSalt                  string //海通加密使用的盐
 	HtgjName                  string //海通国际名称
+	HtgjPublicMobile          string //海通国际公共请求的手机号
 	ActSendMsgMobile          string //活动带问发送模板消息接收者的手机号
 	StrategyPlatform          string //策略品台跳转链接地址
 	ArticleTaskClassMobile    string //策略平台报告自动归类消息通知对象
@@ -120,6 +121,7 @@ func init() {
 	HtgjDefaultSaleName = "王芳"
 	HtgjSalt = "HTGJ&HZ"
 	HtgjName = "海通国际"
+	HtgjPublicMobile = "18767183955"
 	StrategyPlatform = "https://vmp.hzinsights.com/v2/articles/"
 	if RunMode == "release" {
 		WxAppId = "wxcc32b61f96720d2f"

+ 6 - 0
utils/constants.go

@@ -70,3 +70,9 @@ const (
 	TEMPLATE_MSG_CYGX_ARTICLE_ADD  = 13 //查研观向报告更新推送  13
 	TEMPLATE_MSG_CYGX_APPLY        = 14 //查研观向审批通知
 )
+
+const (
+	CHART_PERMISSION_NAME_YANXUAN    = "研选"
+	CHART_PERMISSION_NAME_MF_YANXUAN = "买方研选"
+	CHART_PERMISSION_ID_YANXUAN      = 31
+)