Răsfoiți Sursa

活动临时标签展示处理

xingzai 2 ani în urmă
părinte
comite
12b18d15a3
3 a modificat fișierele cu 10 adăugiri și 6 ștergeri
  1. 4 4
      controllers/activity.go
  2. 2 1
      models/activity.go
  3. 4 1
      services/activity.go

+ 4 - 4
controllers/activity.go

@@ -3313,7 +3313,7 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 		}
 		//标签字段关联的产业与标签处理
 		for k2, v2 := range labelList {
-			labelList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName)
+			labelList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
 			labelList[k2].ImgUrlBg = v.ImgUrlBgs
 		}
 		list[k].List = labelList
@@ -3358,7 +3358,7 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 			return
 		}
 		for k2, v2 := range specialList {
-			specialList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName)
+			specialList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
 			specialList[k2].ImgUrlBg = "https://hzstatic.hzinsights.com/static/temp/20220426202204/20220426/XDLLsjC9XAAy8LIzQr7GsjrBbtX6.png"
 		}
 
@@ -4301,7 +4301,7 @@ func (this *ActivityCoAntroller) LabelTypeListV6Pc() {
 		}
 		//标签字段关联的产业与标签处理
 		for k2, v2 := range labelList {
-			labelList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName)
+			labelList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
 			labelList[k2].Resource = 1
 		}
 		list[k].List = labelList
@@ -4345,7 +4345,7 @@ func (this *ActivityCoAntroller) LabelTypeListV6Pc() {
 			return
 		}
 		for k2, v2 := range specialList {
-			specialList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName)
+			specialList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
 			specialList[k2].Resource = 2
 		}
 

+ 2 - 1
models/activity.go

@@ -537,12 +537,13 @@ type CygxActivityLabelList struct {
 	ActivityId        int    `description:"活动ID "`
 	IsShowSubjectName int    `description:"小程序内是否展示标的名称 1是 ,0否 默认0 "`
 	Resource          int    `description:"位置 ,1:活动 ,2:专项产业调研"`
+	TemporaryLabel    string `description:"临时标签"`
 }
 
 //主题列表
 func GetActivityLabelListAll(condition, sortTime string, pars []interface{}, startSize, pageSize int) (items []*CygxActivityLabelList, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT	label,is_show_subject_name, MAX( art.activity_time ) AS timesort, MIn( art.activity_time ) AS mintimesort 
+	sql := `SELECT	label,temporary_label,is_show_subject_name, MAX( art.activity_time ) AS timesort, MIn( art.activity_time ) AS mintimesort 
 		FROM cygx_activity as art WHERE 1= 1 `
 	if condition != "" {
 		sql += condition

+ 4 - 1
services/activity.go

@@ -735,7 +735,7 @@ func LabelStr(label string) (labelNew string) {
 }
 
 //5.3版本活动标签字符串处理
-func LabelStrV5(label string, isShowSubjectName int) (labelNew string) {
+func LabelStrV5(label string, isShowSubjectName int, temporaryLabel string) (labelNew string) {
 	slicebr := strings.Split(label, "-")
 	if len(slicebr) > 1 {
 		if isShowSubjectName == 1 {
@@ -746,6 +746,9 @@ func LabelStrV5(label string, isShowSubjectName int) (labelNew string) {
 	} else {
 		labelNew = label
 	}
+	if temporaryLabel != "" {
+		labelNew = temporaryLabel
+	}
 	return labelNew
 }