Просмотр исходного кода

Merge branch 'crm/crm_14.7.1' of http://8.136.199.33:3000/hongze/hz_crm_api into debug

xingzai 11 месяцев назад
Родитель
Сommit
686b0b6b0a
3 измененных файлов с 30 добавлено и 16 удалено
  1. 12 16
      controllers/cygx/user.go
  2. 1 0
      models/cygx/cygx_user.go
  3. 17 0
      services/cygx/article.go

+ 12 - 16
controllers/cygx/user.go

@@ -814,6 +814,7 @@ func (this *UserController) TableDetail() {
 					mapAricleId[v.ArticleId] = v.ArticleId
 				}
 				list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
+				list[k].RegisterPlatformText = cygxService.GetArticleSourcePlatformText(v.RegisterPlatform)
 				articleIdArr = append(articleIdArr, v.ArticleId)
 			}
 			articleIds = strings.TrimRight(articleIds, ",")
@@ -1129,6 +1130,7 @@ func (this *UserController) TableDetail() {
 		if len(list) > 0 {
 			for k, v := range list {
 				list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
+				list[k].RegisterPlatformText = cygxService.GetArticleSourcePlatformText(v.RegisterPlatform)
 			}
 		}
 	} else if source == 12 { //收藏的专栏文章
@@ -1153,6 +1155,7 @@ func (this *UserController) TableDetail() {
 		if len(list) > 0 {
 			for k, v := range list {
 				list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
+				list[k].RegisterPlatformText = cygxService.GetArticleSourcePlatformText(v.RegisterPlatform)
 			}
 		}
 	} else if source == 13 { //关注的专栏作者
@@ -1675,6 +1678,7 @@ func (this *UserController) InteractionRelevant() {
 			if len(resp.List) > 0 {
 				for k, v := range resp.List {
 					resp.List[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
+					resp.List[k].RegisterPlatformText = cygxService.GetArticleSourcePlatformText(v.RegisterPlatform)
 					if v.ArticleId >= utils.SummaryArticleId {
 						resp.List[k].ArticleType = 1
 					} else {
@@ -2352,6 +2356,7 @@ func (this *UserController) CompanyTableDetail() {
 		br.Msg = "用户不存在"
 		return
 	}
+	fmt.Println("ClassType", classType)
 	// 1.标记用户表
 	//操作权限校验
 	resp := new(cygx.UserInteractionListResp)
@@ -2367,22 +2372,6 @@ func (this *UserController) CompanyTableDetail() {
 		condition += ` AND ( r.mobile LIKE '%` + keyWord + `%' OR r.email LIKE '%` + keyWord + `%' OR r.real_name LIKE '%` + keyWord + `%')`
 	}
 
-	conditionArtcile := condition       //文章搜索条件
-	conditionActivityMeet := condition  //活动到会搜索条件
-	conditionIndustryFllow := condition //产业关注搜索条件
-	conditionKeyWord := condition       //关键词记录搜索条件
-	if classType == 1 {
-		conditionArtcile += " AND art.article_type_id = 0  "
-		conditionActivityMeet += " AND a.chart_permission_id  != 31  "
-		conditionIndustryFllow += " AND m.chart_permission_id  != 31  "
-		conditionKeyWord += " AND r.register_platform IN (1,2)  "
-	} else {
-		conditionArtcile += " AND art.article_type_id > 0  "
-		conditionActivityMeet += " AND a.chart_permission_id  = 31  "
-		conditionIndustryFllow += " AND m.chart_permission_id  = 31  "
-		conditionKeyWord += " AND r.register_platform IN (5,6)  "
-	}
-
 	var isAdminRole bool
 	//如果不是管理员身份或者研究员身份则需要添加可见范围处理
 	if sysUser.Role == utils.ROLE_TYPE_CODE_ADMIN || sysUser.Role == utils.ROLE_TYPE_CODE_RESEARCHR {
@@ -2398,6 +2387,7 @@ func (this *UserController) CompanyTableDetail() {
 			endDate += " 23:59:59"
 			condition += ` AND r.create_time <= '` + endDate + `' `
 		}
+		condition += " AND r.source = 'article'  "
 		if classType == 1 {
 			condition += " AND art.article_type_id = 0  "
 		} else {
@@ -2833,6 +2823,7 @@ func (this *UserController) CompanyTableDetail() {
 		if len(list) > 0 {
 			for k, v := range list {
 				list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
+				list[k].RegisterPlatformText = cygxService.GetArticleSourcePlatformText(v.RegisterPlatform)
 			}
 		}
 	} else if source == 12 { //收藏的专栏文章
@@ -2854,6 +2845,7 @@ func (this *UserController) CompanyTableDetail() {
 		if len(list) > 0 {
 			for k, v := range list {
 				list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
+				list[k].RegisterPlatformText = cygxService.GetArticleSourcePlatformText(v.RegisterPlatform)
 			}
 		}
 	} else if source == 13 { //关注的专栏作者
@@ -2875,6 +2867,7 @@ func (this *UserController) CompanyTableDetail() {
 		if len(list) > 0 {
 			for k, v := range list {
 				list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
+				list[k].RegisterPlatformText = cygxService.GetArticleSourcePlatformText(v.RegisterPlatform)
 			}
 		}
 	}
@@ -4028,6 +4021,7 @@ func (this *UserController) CompanyList() {
 		if len(list) > 0 {
 			for k, v := range list {
 				list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
+				list[k].RegisterPlatformText = cygxService.GetArticleSourcePlatformText(v.RegisterPlatform)
 			}
 		}
 	} else if source == 12 { //收藏的专栏文章
@@ -4049,6 +4043,7 @@ func (this *UserController) CompanyList() {
 		if len(list) > 0 {
 			for k, v := range list {
 				list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
+				list[k].RegisterPlatformText = cygxService.GetArticleSourcePlatformText(v.RegisterPlatform)
 			}
 		}
 	} else if source == 13 { //关注的专栏作者
@@ -4070,6 +4065,7 @@ func (this *UserController) CompanyList() {
 		if len(list) > 0 {
 			for k, v := range list {
 				list[k].RegisterPlatform = cygxService.GetArticleSourcePlatform(v.SourcePlatform)
+				list[k].RegisterPlatformText = cygxService.GetArticleSourcePlatformText(v.RegisterPlatform)
 			}
 		}
 	}

+ 1 - 0
models/cygx/cygx_user.go

@@ -353,6 +353,7 @@ type UserInteraction struct {
 	IsEnd                 bool   `description:"是否最后一页,配合前端分页添加的参数"`
 	CurrentIndex          int    `description:"当前页页码,配合前端分页添加的参数"`
 	RegisterPlatform      int    `description:"来源 1小程序,2:网页 ,3:策略平台"`
+	RegisterPlatformText  string `description:"阅读来源(文本描述)"`
 	SourcePlatform        string `description:"来源 'MOBILE:移动端小程序','PC:PC端小程序','CELUE:上海策略平台','WEB:查研观向网页版'"`
 	TagId                 int
 	TagName               string // 标签名

+ 17 - 0
services/cygx/article.go

@@ -92,6 +92,23 @@ func GetArticleSourcePlatform(SourcePlatform string) (sourcePlatformResp int) {
 	return
 }
 
+// 处理文章来源类型
+func GetArticleSourcePlatformText(sourcePlatformResp int) (sourcePlatformText string) {
+	switch sourcePlatformResp {
+	case 1:
+		sourcePlatformText = "查研小程序"
+	case 2:
+		sourcePlatformText = "查研网页版"
+	case 3:
+		sourcePlatformText = "策略平台"
+	case 5:
+		sourcePlatformText = "研选小程序"
+	case 6:
+		sourcePlatformText = "研选网页版"
+	}
+	return
+}
+
 //func init() {
 //	GetArticleSubjectLabelByArticleId([]int{9551, 9082})
 //}