Browse Source

查研观向6.5

xingzai 2 years ago
parent
commit
e1c7ccf533

+ 40 - 30
controllers/activity.go

@@ -150,7 +150,8 @@ func (this *ActivityCoAntroller) ActivityList() {
 	var permissionSqlStr string
 	for _, v := range slicePer {
 		if userType == 1 {
-			if v != "研选" {
+			//if v != "研选" {
+			if !strings.Contains(v, "研选") {
 				permissionSqlStr += "'" + v + "',"
 			}
 		} else {
@@ -331,11 +332,11 @@ func (this *ActivityCoAntroller) ActivityList() {
 		if v.SignupNum > v.LimitPeopleNum {
 			list[k].SignupNum = v.LimitPeopleNum
 		}
-		if isShow && v.ChartPermissionName == "研选" {
+		if isShow && strings.Contains(v.ChartPermissionName, "研选") {
 			list[k].IsShowSustainable = true
 		}
-		if v.ChartPermissionName == "研选" && v.ActivityTypeId == 1 {
-			list[k].ActivityTypeName = "研选电话会"
+		if strings.Contains(v.ChartPermissionName, "研选") && v.ActivityTypeId == 1 {
+			list[k].ActivityTypeName = "买方研选电话会"
 			list[k].ImgUrlText = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202112/20211221/bIdfv8t86xrFRpDOeGGHXOmKEuKl.png"
 		}
 		if v.ActivityType == 0 {
@@ -504,11 +505,11 @@ func (this *ActivityCoAntroller) ScheduleList() {
 			list[k].SignupNum = v.LimitPeopleNum
 		}
 		//是否展示限免标签
-		if isShow && v.ChartPermissionName == "研选" {
+		if isShow && strings.Contains(v.ChartPermissionName, "研选") {
 			list[k].IsShowSustainable = true
 		}
-		if v.ChartPermissionName == "研选" && v.ActivityTypeId == 1 {
-			list[k].ActivityTypeName = "研选电话会"
+		if strings.Contains(v.ChartPermissionName, "研选") && v.ActivityTypeId == 1 {
+			list[k].ActivityTypeName = "买方研选电话会"
 			list[k].ImgUrlText = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202112/20211221/bIdfv8t86xrFRpDOeGGHXOmKEuKl.png"
 		}
 		if v.ActivityType == 0 {
@@ -688,7 +689,7 @@ func (this *ActivityCoAntroller) Detail() {
 		}
 	}
 
-	if userType == 1 && activityInfo.ChartPermissionName == "研选" {
+	if userType == 1 && strings.Contains(activityInfo.ChartPermissionName, "研选") {
 		br.Msg = "您暂无查看该活动权限"
 		br.ErrMsg = "被分享客户不可见,永续客户无法查看研选行业"
 		return
@@ -804,7 +805,7 @@ func (this *ActivityCoAntroller) Detail() {
 	}
 	if hasPermission == 1 {
 		//是否展示限免标签
-		if services.GetShowSustainable() && activityInfo.ChartPermissionName == "研选" {
+		if services.GetShowSustainable() && strings.Contains(activityInfo.ChartPermissionName, "研选") {
 			activityInfo.IsShowSustainable = true
 		}
 		configCode := "description_of_research"
@@ -978,7 +979,7 @@ func (this *ActivityCoAntroller) SignupAdd() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
-	if userType == 1 && activityInfo.ChartPermissionName == "研选" {
+	if userType == 1 && strings.Contains(activityInfo.ChartPermissionName, "研选") {
 		br.Msg = "您暂无查看该活动权限"
 		br.ErrMsg = "被分享客户不可见,永续客户无法查看研选行业"
 		return
@@ -1480,7 +1481,8 @@ func (this *ActivityCoAntroller) GetUserSearchContent() {
 	var listChartPermissionidNew2 []*models.ActivityChartPermission
 	for _, v := range list2 {
 		if userType == 1 {
-			if v.PermissionName != "研选" {
+			//if v.PermissionName != "研选" {
+			if !strings.Contains(v.PermissionName, "研选") {
 				listChartPermissionidNew2 = append(listChartPermissionidNew2, v)
 			}
 		} else {
@@ -1491,7 +1493,7 @@ func (this *ActivityCoAntroller) GetUserSearchContent() {
 	var listChartPermissionidNew []*models.ActivityChartPermission
 	for _, v := range listChartPermissionid {
 		if userType == 1 {
-			if v.PermissionName != "研选" {
+			if !strings.Contains(v.PermissionName, "研选") {
 				listChartPermissionidNew = append(listChartPermissionidNew, v)
 			}
 		} else {
@@ -1631,7 +1633,7 @@ func (this *ActivityCoAntroller) MeetingReminderAdd() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
-	if userType == 1 && activityInfo.ChartPermissionName == "研选" {
+	if userType == 1 && strings.Contains(activityInfo.ChartPermissionName, "研选") {
 		br.Msg = "您暂无查看该活动权限"
 		br.ErrMsg = "被分享客户不可见,永续客户无法查看研选行业"
 		return
@@ -1928,7 +1930,8 @@ func (this *ActivityCoAntroller) LabelList() {
 	var permissionSqlStr string
 	for _, v := range slicePer {
 		if userType == 1 {
-			if v != "研选" {
+			//if v != "研选" {
+			if !strings.Contains(v, "研选") {
 				permissionSqlStr += "'" + v + "',"
 			}
 		} else {
@@ -2270,7 +2273,8 @@ func (this *ActivityCoAntroller) LabelTypeList() {
 	var permissionNameStr string
 	for _, v := range slicePer {
 		if userType == 1 {
-			if v != "研选" {
+			//if v != "研选" {
+			if !strings.Contains(v, "研选") {
 				permissionNameStr += "'" + v + "',"
 			}
 		} else {
@@ -2469,7 +2473,8 @@ func (this *ActivityCoAntroller) LabelMoreList() {
 	var permissionSqlStr string
 	for _, v := range slicePer {
 		if userType == 1 {
-			if v != "研选" {
+			//if v != "研选" {
+			if !strings.Contains(v, "研选") {
 				permissionSqlStr += "'" + v + "',"
 			}
 		} else {
@@ -2640,7 +2645,8 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 	var permissionSqlStr string
 	for _, v := range slicePer {
 		if userType == 1 {
-			if v != "研选" {
+			//if v != "研选" {
+			if !strings.Contains(v, "研选") {
 				permissionSqlStr += "'" + v + "',"
 			}
 		} else {
@@ -2787,11 +2793,11 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 		if v.SignupNum > v.LimitPeopleNum {
 			list[k].SignupNum = v.LimitPeopleNum
 		}
-		if isShow && v.ChartPermissionName == "研选" {
+		if isShow && strings.Contains(v.ChartPermissionName, "研选") {
 			list[k].IsShowSustainable = true
 		}
-		if v.ChartPermissionName == "研选" && v.ActivityTypeId == 1 {
-			list[k].ActivityTypeName = "研选电话会"
+		if strings.Contains(v.ChartPermissionName, "研选") && v.ActivityTypeId == 1 {
+			list[k].ActivityTypeName = "买方研选电话会"
 			list[k].ImgUrlText = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202112/20211221/bIdfv8t86xrFRpDOeGGHXOmKEuKl.png"
 		}
 		if v.ActivityType == 0 {
@@ -2890,7 +2896,8 @@ func (this *ActivityCoAntroller) LabelTypeListPc() {
 	var permissionNameStr string
 	for _, v := range slicePer {
 		if userType == 1 {
-			if v != "研选" {
+			//if v != "研选" {
+			if !strings.Contains(v, "研选") {
 				permissionNameStr += "'" + v + "',"
 			}
 		} else {
@@ -3130,7 +3137,7 @@ func (this *ActivityCoAntroller) CheckAsk() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
-	if userType == 1 && activityInfo.ChartPermissionName == "研选" {
+	if userType == 1 && strings.Contains(activityInfo.ChartPermissionName, "研选") {
 		br.Msg = "您暂无查看该活动权限"
 		br.ErrMsg = "被分享客户不可见,永续客户无法查看研选行业"
 		return
@@ -3265,7 +3272,8 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 	var permissionNameStr string
 	for _, v := range slicePer {
 		if userType == 1 {
-			if v != "研选" {
+			//if v != "研选" {
+			if !strings.Contains(v, "研选") {
 				permissionNameStr += "'" + v + "',"
 			}
 		} else {
@@ -3527,7 +3535,8 @@ func (this *ActivityCoAntroller) SpecialList() {
 	var permissionSqlStr string
 	for _, v := range slicePer {
 		if userType == 1 {
-			if v != "研选" {
+			//if v != "研选" {
+			if !strings.Contains(v, "研选") {
 				permissionSqlStr += "'" + v + "',"
 			}
 		} else {
@@ -3797,7 +3806,7 @@ func (this *ActivityCoAntroller) SpecialDetail() {
 		return
 	}
 
-	if userType == 1 && activityInfo.ChartPermissionName == "研选" {
+	if userType == 1 && strings.Contains(activityInfo.ChartPermissionName, "研选") {
 		br.Msg = "您暂无查看该活动权限"
 		br.ErrMsg = "被分享客户不可见,永续客户无法查看研选行业"
 		return
@@ -4023,7 +4032,7 @@ func (this *ActivityCoAntroller) SpecialSignupAdd() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
-	if userType == 1 && activityInfo.ChartPermissionName == "研选" {
+	if userType == 1 && strings.Contains(activityInfo.ChartPermissionName, "研选") {
 		br.Msg = "您暂无查看该活动权限"
 		br.ErrMsg = "被分享客户不可见,永续客户无法查看研选行业"
 		return
@@ -4281,7 +4290,8 @@ func (this *ActivityCoAntroller) LabelTypeListV6Pc() {
 	var permissionNameStr string
 	for _, v := range slicePer {
 		if userType == 1 {
-			if v != "研选" {
+			//if v != "研选" {
+			if !strings.Contains(v, "研选") {
 				permissionNameStr += "'" + v + "',"
 			}
 		} else {
@@ -4427,8 +4437,8 @@ func (this *ActivityCoAntroller) LabelTypeListV6Pc() {
 	itemList.Resource = 2
 	itemList.List = specialList
 	itemList.ActivityTypeId = 7
-	itemList.OnlineIco = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202112/20211224/Yq5Ty2DCKTP5N8SdwcYHHTGvTgaS.png"
-	itemList.ImgUrlBgPc = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202112/20211224/FTPPvpNfILLOGSoV4Ddcc0gIuNEW.png"
+	itemList.OnlineIco = "https://hzstatic.hzinsights.com/static/temp/20220707202207/20220707/0H4md6VgZMuIttggMUnJxgrlayxC.png"
+	itemList.ImgUrlBgPc = "https://hzstatic.hzinsights.com/static/temp/20220707202207/20220707/rFwAM1c4fIMJM0EGoUkUYl25XH9L.png"
 	list = append(list, itemList)
 	//记录用户搜索的筛选条件
 	item := new(models.CygxActivitySearchHistory)
@@ -4584,7 +4594,7 @@ func (this *ActivityCoAntroller) ActivityAppointmentAdd() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
-	if userType == 1 && activityInfo.ChartPermissionName == "研选" {
+	if userType == 1 && strings.Contains(activityInfo.ChartPermissionName, "研选") {
 		br.Msg = "您暂无查看该活动权限"
 		br.ErrMsg = "被分享客户不可见,永续客户无法查看研选行业"
 		return

+ 5 - 0
controllers/article.go

@@ -1174,6 +1174,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

+ 17 - 13
controllers/home.go

@@ -89,9 +89,9 @@ func (this *HomeController) ListHome() {
 		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 '%研选%' AND publish_status = 1 AND is_summary = 1 )`
 		} else {
-			condition += ` AND  category_name   LIKE '%` + categoryinfo.PermissionName + `%'`
+			condition += ` AND  category_name  LIKE '%研选%' `
 		}
 	}
 	//永续客户无法查看研选分类的内容
@@ -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 '%` + 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 {
@@ -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 {

+ 20 - 8
controllers/report.go

@@ -1408,6 +1408,12 @@ func (this *ReportController) ResearchDetail() {
 		br.ErrMsg = "获取子类信息失败,Err:" + err.Error()
 		return
 	}
+	listArticleType, err := models.GetCygxArticleTypeList()
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取文章类型数据失败,Err:" + err.Error()
+		return
+	}
 	for k, v := range listFirst {
 		listSecond, err := models.GetResearchSummarylogSonListSecond(articleId, v.Type)
 		if err != nil && err.Error() != utils.ErrNoRow() {
@@ -1422,13 +1428,19 @@ func (this *ReportController) ResearchDetail() {
 				br.ErrMsg = "获取信息失败,Err:" + err.Error()
 				return
 			}
-			if v2.ChartPermissionId == utils.YanxSummaryPermissionId {
-				listSecond[k2].IcoLink = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202111/20211104/QbTGTNhD9MxYp24cJ7V5WpCN0oNl.png"
-				listSecond[k2].PermissionName = "研选纪要"
-			} else if v2.ChartPermissionId == utils.YanxViewpointPermissionId {
-				listSecond[k2].IcoLink = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202111/20211104/QbTGTNhD9MxYp24cJ7V5WpCN0oNl.png"
-				listSecond[k2].PermissionName = "研选观点"
+			for _, vType := range listArticleType {
+				if v2.ChartPermissionId == vType.YanxPermissionId {
+					listSecond[k2].IcoLink = vType.IcoLinkM
+					listSecond[k2].PermissionName = vType.YanxPermissionName
+				}
 			}
+			//if v2.ChartPermissionId == utils.YanxSummaryPermissionId {
+			//	listSecond[k2].IcoLink = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202111/20211104/QbTGTNhD9MxYp24cJ7V5WpCN0oNl.png"
+			//	listSecond[k2].PermissionName = "买方研选纪要"
+			//} else if v2.ChartPermissionId == utils.YanxViewpointPermissionId {
+			//	listSecond[k2].IcoLink = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202111/20211104/QbTGTNhD9MxYp24cJ7V5WpCN0oNl.png"
+			//	listSecond[k2].PermissionName = "买方研选观点"
+			//}
 			if len(listThird) > 0 {
 				for k3, v3 := range listThird {
 					if v3.VideoUrl != "" {
@@ -1461,7 +1473,7 @@ func (this *ReportController) ResearchDetail() {
 			listFirst[k].ListName = "事件点评"
 			listFirst[k].IcoLink = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202110/20211020/2a5cXafO3Iws4QcFp1bd5WPdYikV.png"
 		} else if v.Type == "YANX" {
-			listFirst[k].ListName = "研选"
+			listFirst[k].ListName = "买方研选"
 			listFirst[k].IcoLink = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202111/20211104/QbTGTNhD9MxYp24cJ7V5WpCN0oNl.png"
 		}
 	}
@@ -1583,7 +1595,7 @@ func (this *ReportController) MinutesDetailV4() {
 			listFirst[k].ListName = "上市公司调研纪要篇"
 			listFirst[k].IcoLink = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202111/20211101/ujHXB48I8ay9T0XoPRI7lorz7OkL.png"
 		} else if v.Type == "YANX" {
-			listFirst[k].ListName = "研选纪要"
+			listFirst[k].ListName = "买方研选纪要"
 			listFirst[k].IcoLink = "https://hongze.oss-cn-shanghai.aliyuncs.com/static/images/202111/20211104/QbTGTNhD9MxYp24cJ7V5WpCN0oNl.png"
 		}
 	}

+ 12 - 34
controllers/research.go

@@ -34,13 +34,7 @@ func (this *ResearchController) NewList() {
 		br.Msg = "请输入分类ID"
 		return
 	}
-	categoryinfo, err := models.GetChartPermissionById(chartPermissionId)
-	if err != nil {
-		br.Msg = "获取信息失败"
-		br.ErrMsg = "获取信息失败,Err:" + err.Error()
-		return
-	}
-	list, err := models.GetIndustrialManagementNewList(categoryinfo.PermissionName)
+	list, err := models.GetIndustrialManagementNewList()
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
@@ -49,7 +43,7 @@ func (this *ResearchController) NewList() {
 	mapHot := make(map[string]int)
 
 	condition := ` ORDER BY sum_num DESC  `
-	listHot, err := models.GetThemeHeatList(categoryinfo.PermissionName, user.UserId, condition, 0, 3)
+	listHot, err := models.GetThemeHeatList(user.UserId, condition, 0, 3)
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
@@ -93,14 +87,8 @@ func (this *ResearchController) CollectionList() {
 		br.Msg = "请输入分类ID"
 		return
 	}
-	categoryinfo, err := models.GetChartPermissionById(chartPermissionId)
-	if err != nil {
-		br.Msg = "获取信息失败"
-		br.ErrMsg = "获取信息失败,Err:" + err.Error()
-		return
-	}
 	var condition string
-	condition = `  AND a.category_name LIKE '%` + categoryinfo.PermissionName + `%' AND publish_status = 1 GROUP BY a.article_id ORDER BY collect_num_order DESC, publish_date DESC LIMIT 15 `
+	condition = `   AND a.article_type_id > 0  AND publish_status = 1 GROUP BY a.article_id ORDER BY collect_num_order DESC, publish_date DESC LIMIT 15 `
 	list, err := models.GetArticleCollectionList(condition, user.UserId)
 	if err != nil {
 		br.Msg = "获取信息失败"
@@ -162,26 +150,21 @@ func (this *ResearchController) HotList() {
 	} else {
 		condition = `ORDER BY publish_date DESC `
 	}
-	categoryinfo, err := models.GetChartPermissionById(chartPermissionId)
-	if err != nil {
-		br.Msg = "获取信息失败"
-		br.ErrMsg = "获取信息失败,Err:" + err.Error()
-		return
-	}
-	total, err := models.GetThemeHeatListCount(categoryinfo.PermissionName, "")
+
+	total, err := models.GetThemeHeatListCount("")
 	if err != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
-	list, err := models.GetThemeHeatList(categoryinfo.PermissionName, user.UserId, condition, startSize, pageSize)
+	list, err := models.GetThemeHeatList(user.UserId, condition, startSize, pageSize)
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
 		return
 	}
 	newMap := make(map[int]string)
-	listNew, err := models.GetIndustrialManagementNewList(categoryinfo.PermissionName)
+	listNew, err := models.GetIndustrialManagementNewList()
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取产业最新信息失败,Err:" + err.Error()
@@ -190,7 +173,7 @@ func (this *ResearchController) HotList() {
 	for _, v := range listNew {
 		newMap[v.IndustrialManagementId] = v.IndustryName
 	}
-	condition = ` AND a.category_name LIKE '%` + categoryinfo.PermissionName + `%' `
+	condition = ` AND a.article_type_id > 0  `
 	listSubjcet, err := models.GetThemeHeatSubjectList(condition)
 	if err != nil {
 		br.Msg = "获取信息失败"
@@ -200,7 +183,7 @@ func (this *ResearchController) HotList() {
 	mapHot := make(map[string]int)
 
 	condition = ` ORDER BY sum_num DESC `
-	listHot, err := models.GetThemeHeatList(categoryinfo.PermissionName, user.UserId, condition, 0, 3)
+	listHot, err := models.GetThemeHeatList(user.UserId, condition, 0, 3)
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
@@ -257,19 +240,14 @@ func (this *ResearchController) KolList() {
 		br.Msg = "请输入分类ID"
 		return
 	}
-	categoryinfo, err := models.GetChartPermissionById(chartPermissionId)
-	if err != nil {
-		br.Msg = "获取信息失败"
-		br.ErrMsg = "获取信息失败,Err:" + err.Error()
-		return
-	}
-	list, err := models.GetDepartmentList(categoryinfo.PermissionName, user.UserId)
+
+	list, err := models.GetDepartmentList(user.UserId)
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
 		return
 	}
-	listIndustrial, err := models.GetIndustrialDepartmentList(categoryinfo.PermissionName)
+	listIndustrial, err := models.GetIndustrialDepartmentList()
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()

+ 6 - 0
controllers/search.go

@@ -331,6 +331,12 @@ func (this *BaseSearchController) SearchListPublic() {
 			go models.AddSearchKeyWord(keyWordItem)
 		}
 	}
+
+	for k, _ := range result {
+		if result[k].ArticleId < utils.SummaryArticleId {
+			result[k].IsNeedJump = true
+		}
+	}
 	resp := new(models.SearchResp)
 	page := paging.GetPaging(currentIndex, pageSize, int(total))
 	resp.Paging = page

+ 22 - 1
models/article.go

@@ -157,7 +157,7 @@ type SellerRep struct {
 
 func GetArticleDetailById(articleId int) (item *ArticleDetail, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT * FROM cygx_article WHERE article_id = ? `
+	sql := `SELECT * FROM cygx_article WHERE article_id = ?  AND publish_status = 1  `
 	err = o.Raw(sql, articleId).QueryRow(&item)
 	return
 }
@@ -611,3 +611,24 @@ WHERE
 	err = o.Raw(sql).QueryRow(&articleid)
 	return
 }
+
+type CygxArticleType struct {
+	ArticleTypeId      int       `orm:"column(article_type_id);pk";description:"文章类型ID"`
+	ArticleTypeName    string    `description:"类型名称"`
+	Sort               int       `description:"排序字段"`
+	CreateTime         time.Time `description:"创建时间"`
+	ModifyTime         time.Time `description:"最后修改时间"`
+	IsSendEs           int       `description:"这种报告类型是否同步到Es"`
+	YanxPermissionId   int       `description:"研选类型所对应的ID"`
+	YanxPermissionName string    `description:"研选类型所对应的名称"`
+	IcoLink            string    `description:"图标链接地址"`
+	IcoLinkM           string    `description:"移动端图标链接地址"`
+}
+
+//报告类型列表
+func GetCygxArticleTypeList() (items []*CygxArticleType, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_article_type ORDER BY sort DESC`
+	_, err = o.Raw(sql).QueryRows(&items)
+	return
+}

+ 2 - 2
models/industrial_management.go

@@ -358,7 +358,7 @@ type IndustrialManagementNewList struct {
 }
 
 //近期更新主题列表
-func GetIndustrialManagementNewList(permissionName string) (items []*IndustrialManagementNewResp, err error) {
+func GetIndustrialManagementNewList() (items []*IndustrialManagementNewResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
 			m.industrial_management_id,
@@ -371,7 +371,7 @@ func GetIndustrialManagementNewList(permissionName string) (items []*IndustrialM
 			INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = mg.industrial_management_id 
 		WHERE
 			1 = 1
-			AND a.category_name LIKE '%` + permissionName + `%' 
+			AND a.article_type_id > 0
 			AND publish_status = 1 
 		GROUP BY
 			m.industrial_management_id 

+ 1 - 1
models/minutesSummary.go

@@ -105,7 +105,7 @@ func GetMinutesSummarylogSonListAll(articleId, chartPermissionId int) (items []*
 //列表
 func GetMinutesSummarylogSonListSecond(articleId int, artType string) (items []*CygxResearchSummaryLogSecond, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT c.permission_name ,c.chart_permission_id ,c.image_url, l.* 
+	sql := `SELECT c.permission_name ,c.chart_permission_id ,c.image_url_m as image_url, l.* 
 			FROM
 			cygx_minutes_summary_log AS l
 			LEFT JOIN chart_permission AS c ON c.chart_permission_id = l.chart_permission_id 

+ 9 - 10
models/report.go

@@ -351,7 +351,7 @@ func GetArticleCollectionList(condition string, userId int) (items []*ArticleCol
 			INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = mg.industrial_management_id
 			INNER JOIN cygx_article_department AS d ON d.department_id = a.department_id 
 		WHERE
-			1 = 1 `
+			1 = 1  AND a.publish_status = 1  `
 	if condition != "" {
 		sql += condition
 	}
@@ -379,7 +379,7 @@ type IndustrialManagementHotListResp struct {
 }
 
 //产业列表
-func GetThemeHeatList(permissionName string, userId int, condition string, startSize, pageSize int) (items []*IndustrialManagementHotResp, err error) {
+func GetThemeHeatList(userId int, condition string, startSize, pageSize int) (items []*IndustrialManagementHotResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
 			m.industry_name,
@@ -395,7 +395,7 @@ func GetThemeHeatList(permissionName string, userId int, condition string, start
 			LEFT JOIN cygx_industrial_activity_group_management as ag ON ag.industrial_management_id = mg.industrial_management_id
 		WHERE
 			1 = 1
-			AND a.category_name LIKE '%` + permissionName + `%' 
+			AND a.article_type_id > 0
 			AND publish_status = 1 
 			GROUP BY m.industrial_management_id ` + condition + ` LIMIT ?,?`
 	_, err = o.Raw(sql, userId, startSize, pageSize).QueryRows(&items)
@@ -403,7 +403,7 @@ func GetThemeHeatList(permissionName string, userId int, condition string, start
 }
 
 //获取数量
-func GetThemeHeatListCount(permissionName, condition string) (count int, err error) {
+func GetThemeHeatListCount(condition string) (count int, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT   COUNT( DISTINCT m.industrial_management_id ) FROM
 			cygx_industrial_management AS m
@@ -412,8 +412,7 @@ func GetThemeHeatListCount(permissionName, condition string) (count int, err err
 			LEFT JOIN cygx_industrial_activity_group_management as ag ON ag.industrial_management_id = mg.industrial_management_id
 		WHERE
 			1 = 1
-			AND a.category_name LIKE '%` + permissionName + `%' 
-			AND a.publish_status = 1  ` + condition
+			AND a.article_type_id > 0 AND a.publish_status = 1  ` + condition
 	err = o.Raw(sql).QueryRow(&count)
 	return
 }
@@ -463,7 +462,7 @@ type IndustrialDepartmentListResp struct {
 }
 
 //作者列表
-func GetDepartmentList(permissionName string, userId int) (items []*DepartmentResp, err error) {
+func GetDepartmentList(userId int) (items []*DepartmentResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
 			d.nick_name,
@@ -476,7 +475,7 @@ func GetDepartmentList(permissionName string, userId int) (items []*DepartmentRe
 			INNER JOIN cygx_article AS a ON d.department_id = a.department_id
 		WHERE
 			1 = 1
-			AND a.category_name LIKE '%` + permissionName + `%' 
+			AND a.article_type_id > 0 
 			AND publish_status = 1 
 		GROUP BY
 				d.department_id
@@ -488,7 +487,7 @@ func GetDepartmentList(permissionName string, userId int) (items []*DepartmentRe
 }
 
 //作者文章所关联的产业列表
-func GetIndustrialDepartmentList(permissionName string) (items []*IndustrialDepartmentListResp, err error) {
+func GetIndustrialDepartmentList() (items []*IndustrialDepartmentListResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
 			m.industrial_management_id,
@@ -501,7 +500,7 @@ func GetIndustrialDepartmentList(permissionName string) (items []*IndustrialDepa
 			INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = mg.industrial_management_id 
 		WHERE
 			1 = 1
-			AND a.category_name LIKE '%` + permissionName + `%' 
+			AND a.article_type_id > 0
 			AND publish_status = 1 
 		GROUP BY
 			a.article_id 

+ 1 - 1
models/researchSummary.go

@@ -87,7 +87,7 @@ func GetResearchSummarylogListFirst(articleId int) (items []*ResearchSummaryChar
 //列表
 func GetResearchSummarylogSonListSecond(articleId int, artType string) (items []*CygxResearchSummaryLogSecond, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT c.permission_name ,c.chart_permission_id ,c.image_url, l.* 
+	sql := `SELECT c.permission_name ,c.chart_permission_id ,c.image_url_m as image_url, l.* 
 			FROM
 			cygx_research_summary_log AS l
 			LEFT JOIN chart_permission AS c ON c.chart_permission_id = l.chart_permission_id 

+ 1 - 0
models/search.go

@@ -14,6 +14,7 @@ type SearchItem struct {
 	ImgUrlPc         string   `description:"图片链接"`
 	CategoryId       string   `description:"文章分类"`
 	Source           int      `description:"来源  1:文章, 2:图表"`
+	IsNeedJump       bool     `description:"是否需要跳转链接地址"`
 }
 
 type CategoryItem struct {

+ 4 - 4
services/activity.go

@@ -242,7 +242,7 @@ func SendEmailFileToExpert(cont context.Context) (err error) {
 			touser = utils.EmailZhizao
 		} else if activityInfo.ChartPermissionName == "策略" {
 			touser = utils.EmailStrategy
-		} else if activityInfo.ChartPermissionName == "研选" {
+		} else if strings.Contains(activityInfo.ChartPermissionName, "研选") {
 			touser = utils.EmailExpert
 		}
 		sendResult := utils.SendEmailByHongze(title, content, touser, fileName, title+".xlsx")
@@ -410,7 +410,7 @@ func GetHavePower(activityInfo *models.ActivityDetail, permissionStr, companyDet
 			havePower = true
 		}
 	}
-	if (activityInfo.ChartPermissionName == "研选" || activityInfo.ChartPermissionName == "策略") && strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
+	if (strings.Contains(activityInfo.ChartPermissionName, "研选") || activityInfo.ChartPermissionName == "策略") && strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
 		havePower = true
 	}
 	return
@@ -431,7 +431,7 @@ func SendEmailFileForAskMsgResearch(cont context.Context) (err error) {
 		}
 	}()
 	endDate := time.Now().Add(+time.Minute * 60).Format(utils.FormatDateTime)
-	condition := `AND  a.activity_type_id = 1 AND a.chart_permission_name = '研选' `
+	condition := `AND  a.activity_type_id = 1 AND a.chart_permission_id = 31 `
 	total, err := models.GetCountActivityResearchToSendFile(condition, endDate)
 	if total == 0 {
 		fmt.Println("发送附件完成0")
@@ -507,7 +507,7 @@ func SendEmailFileForAskMsg(cont context.Context) (err error) {
 		}
 	}()
 	endDate := time.Now().Add(+time.Minute * 15).Format(utils.FormatDateTime)
-	condition := `AND  a.activity_type_id = 1 AND  a.chart_permission_name != '研选' `
+	condition := `AND  a.activity_type_id = 1 AND  a.chart_permission_id != 31 `
 	total, err := models.GetCountActivityResearchToSendFile(condition, endDate)
 	if total == 0 {
 		fmt.Println("发送附件完成0")

+ 2 - 0
utils/config.go

@@ -70,6 +70,7 @@ var (
 	HtgjDefaultSaleName       string //海通默认销售名称
 	HtgjSalt                  string //海通加密使用的盐
 	HtgjName                  string //海通国际名称
+	HtgjPublicMobile          string //海通国际公共请求的手机号
 	ActSendMsgMobile          string //活动带问发送模板消息接收者的手机号
 	StrategyPlatform          string //策略品台跳转链接地址
 	ArticleTaskClassMobile    string //策略平台报告自动归类消息通知对象
@@ -121,6 +122,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
+)