Browse Source

no message

xingzai 9 months ago
parent
commit
bb3a252321
2 changed files with 27 additions and 0 deletions
  1. 10 0
      controllers/cygx/user.go
  2. 17 0
      services/cygx/article.go

+ 10 - 0
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 {
@@ -2819,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 { //收藏的专栏文章
@@ -2840,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 { //关注的专栏作者
@@ -2861,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)
 			}
 		}
 	}
@@ -4014,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 { //收藏的专栏文章
@@ -4035,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 { //关注的专栏作者
@@ -4056,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)
 			}
 		}
 	}

+ 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})
 //}