Browse Source

Merge branch 'cygx_need_p1_859' of http://8.136.199.33:3000/cxzhang/hongze_clpt into debug

xingzai 1 year ago
parent
commit
b11e85b3eb

+ 1 - 1
controllers/collection.go

@@ -32,7 +32,7 @@ func (this *BaseCollectionController) BannerList() {
 	var listA []*models.CollectionBannerResp
 	var listA []*models.CollectionBannerResp
 	listB := new(models.CollectionBannerResp)
 	listB := new(models.CollectionBannerResp)
 	listA = []*models.CollectionBannerResp{
 	listA = []*models.CollectionBannerResp{
-		&models.CollectionBannerResp{Title: "路演回放-策略系列培训视频", IndexImg: "https://hzstatic.hzinsights.com/cygx/banner/web/lyhf.png", Path: "https://web.hzinsights.com/internal/article/43"},
+		&models.CollectionBannerResp{Title: "策略系列培训视频", IndexImg: "https://hzstatic.hzinsights.com/cygx/banner/web/lyhf.png", Path: "https://web.hzinsights.com/internal/article/43"},
 	}
 	}
 	listB.Title = "专题看板"
 	listB.Title = "专题看板"
 	listB.IndexImg = "https://hzstatic.hzinsights.com/cygx/banner/web/jxkb.png"
 	listB.IndexImg = "https://hzstatic.hzinsights.com/cygx/banner/web/jxkb.png"

+ 12 - 8
controllers/report.go

@@ -651,15 +651,17 @@ func (this *ReportController) IndustrialFllow() {
 		return
 		return
 	}
 	}
 	resp := new(models.CygxIndustryFllowResp)
 	resp := new(models.CygxIndustryFllowResp)
+	item := new(models.CygxIndustryFllow)
+	item.IndustrialManagementId = industrialManagementId
+	item.UserId = uid
+	item.Email = user.Email
+	item.Mobile = user.Mobile
+	item.RealName = user.RealName
+	item.Source = utils.REGISTER_PLATFORM
+	item.CompanyId = user.CompanyId
+	item.CompanyName = user.CompanyName
+
 	if count == 0 {
 	if count == 0 {
-		item := new(models.CygxIndustryFllow)
-		item.IndustrialManagementId = industrialManagementId
-		item.UserId = uid
-		item.Email = user.Email
-		item.Mobile = user.Mobile
-		item.RealName = user.RealName
-		item.CompanyId = user.CompanyId
-		item.CompanyName = user.CompanyName
 		item.Type = 1
 		item.Type = 1
 		item.CreateTime = time.Now()
 		item.CreateTime = time.Now()
 		item.ModifyTime = time.Now()
 		item.ModifyTime = time.Now()
@@ -672,6 +674,7 @@ func (this *ReportController) IndustrialFllow() {
 		resp.Status = 1
 		resp.Status = 1
 		br.Msg = "关注成功"
 		br.Msg = "关注成功"
 	} else {
 	} else {
+		item.Type = 2
 		err = models.RemoveCygxIndustryFllow(uid, industrialManagementId)
 		err = models.RemoveCygxIndustryFllow(uid, industrialManagementId)
 		if err != nil {
 		if err != nil {
 			br.Msg = "操作失败"
 			br.Msg = "操作失败"
@@ -684,6 +687,7 @@ func (this *ReportController) IndustrialFllow() {
 	//处理是否关注全部赛道字段
 	//处理是否关注全部赛道字段
 	go services.IndustryFllowWithTrack(industrialManagementId, count, uid)
 	go services.IndustryFllowWithTrack(industrialManagementId, count, uid)
 	go services.IndustryFllowUserLabelLogAdd(industrialManagementId, count, uid) //处理用户标签
 	go services.IndustryFllowUserLabelLogAdd(industrialManagementId, count, uid) //处理用户标签
+	go services.AddCygxIndustryFllowLog(item)                                    //添加操作日志记录
 	br.Ret = 200
 	br.Ret = 200
 	br.Success = true
 	br.Success = true
 	br.Data = resp
 	br.Data = resp

+ 1 - 1
controllers/report_selection.go

@@ -138,7 +138,7 @@ func (this *ReportSelectionController) Detail() {
 						listSonLog[k2].OverviewArticleId = 0
 						listSonLog[k2].OverviewArticleId = 0
 					}
 					}
 					listSonLog[k2].List = listIndustrial
 					listSonLog[k2].List = listIndustrial
-					listSonLog[k2].IsShowApplyButton = true
+					//listSonLog[k2].IsShowApplyButton = true
 					if v2.Label != "" {
 					if v2.Label != "" {
 						CompanyLabelSlice := strings.Split(v2.Label, "{|}")
 						CompanyLabelSlice := strings.Split(v2.Label, "{|}")
 						for _, vCompanyLabel := range CompanyLabelSlice {
 						for _, vCompanyLabel := range CompanyLabelSlice {

+ 1 - 0
models/db.go

@@ -82,6 +82,7 @@ func init() {
 		new(CygxBannerYxSurvey),
 		new(CygxBannerYxSurvey),
 		new(CygxApplyCollection),
 		new(CygxApplyCollection),
 		new(CygxReportSelectionLogApply),
 		new(CygxReportSelectionLogApply),
+		new(CygxIndustryFllowLog),
 	)
 	)
 	// 记录ORM查询日志
 	// 记录ORM查询日志
 	orm.Debug = true
 	orm.Debug = true

+ 28 - 0
models/industry_fllow_log.go

@@ -0,0 +1,28 @@
+package models
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"time"
+)
+
+type CygxIndustryFllowLog struct {
+	Id                     int       `orm:"column(id);pk"`
+	IndustrialManagementId int       `description:"产业D"`
+	UserId                 int       `description:"用户ID"`
+	Mobile                 string    `description:"手机号"`
+	Email                  string    `description:"邮箱"`
+	CompanyId              int       `description:"公司id"`
+	CompanyName            string    `description:"公司名称"`
+	Type                   int       `description:"操作方式,1报名,2取消报名"`
+	CreateTime             time.Time `description:"创建时间"`
+	ModifyTime             time.Time `description:"更新时间"`
+	RealName               string    `description:"用户实际名称"`
+	Source                 int       `description:"来源1查研观向,2查研观向小助手,3勾选全部赛道的用户进行自动关注"`
+}
+
+// 添加
+func AddCygxIndustryFllowLog(item *CygxIndustryFllowLog) (lastId int64, err error) {
+	o := orm.NewOrm()
+	lastId, err = o.Insert(item)
+	return
+}

+ 31 - 0
services/industry_fllow.go

@@ -0,0 +1,31 @@
+package services
+
+import (
+	"fmt"
+	"hongze/hongze_clpt/models"
+	"hongze/hongze_clpt/utils"
+	"time"
+)
+
+// 添加用户关注,取消关注产业日志记录
+func AddCygxIndustryFllowLog(item *models.CygxIndustryFllow) (err error) {
+	defer func() {
+		if err != nil {
+			go utils.SendAlarmMsg("添加用户关注,取消关注产业日志记录失败"+err.Error()+fmt.Sprint(item), 2)
+		}
+	}()
+	itemlog := new(models.CygxIndustryFllowLog)
+	itemlog.IndustrialManagementId = item.IndustrialManagementId
+	itemlog.UserId = item.UserId
+	itemlog.Email = item.Email
+	itemlog.Mobile = item.Mobile
+	itemlog.RealName = item.RealName
+	itemlog.CompanyId = item.CompanyId
+	itemlog.CompanyName = item.CompanyName
+	itemlog.Type = item.Type
+	itemlog.Source = utils.REGISTER_PLATFORM
+	itemlog.CreateTime = time.Now()
+	itemlog.ModifyTime = time.Now()
+	_, err = models.AddCygxIndustryFllowLog(itemlog)
+	return err
+}

+ 2 - 1
services/tag.go

@@ -94,7 +94,8 @@ func GetConditionInitByTagIds(tagIds string) (conditionInit string, err error) {
 
 
 	//拼接search_tag 搜索内容
 	//拼接search_tag 搜索内容
 	if len(searchTag) > 0 {
 	if len(searchTag) > 0 {
-		conditionInit += " AND search_tag IN  ('" + strings.Join(searchTag, "','") + "')"
+		//search_tag_two 兼容报告类型一对多的这种,时间不够,产品也有可能变先这么做
+		conditionInit += " AND ( search_tag IN  ('" + strings.Join(searchTag, "','") + "')  OR search_tag_two IN( '" + strings.Join(searchTag, "','") + "' )  )"
 	}
 	}
 
 
 	var resourceDataIds []int //cygx_resource_data 主键ID
 	var resourceDataIds []int //cygx_resource_data 主键ID