浏览代码

专项调研活动首页背景图更换

xingzai 3 年之前
父节点
当前提交
7f0fbbd11a
共有 3 个文件被更改,包括 20 次插入8 次删除
  1. 3 3
      controllers/activity.go
  2. 6 5
      models/activity.go
  3. 11 0
      services/activity.go

+ 3 - 3
controllers/activity.go

@@ -3300,7 +3300,7 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 		}
 		//标签字段关联的产业与标签处理
 		for k2, v2 := range labelList {
-			labelList[k2].KeyWord = services.LabelStr(v2.KeyWord)
+			labelList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName)
 			labelList[k2].ImgUrlBg = v.ImgUrlBgs
 		}
 		list[k].List = labelList
@@ -3346,7 +3346,7 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 		return
 	}
 	for k2, v2 := range specialList {
-		specialList[k2].KeyWord = services.LabelStr(v2.KeyWord)
+		specialList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName)
 		specialList[k2].ImgUrlBg = "https://hzstatic.hzinsights.com/static/temp/20220426202204/20220426/XDLLsjC9XAAy8LIzQr7GsjrBbtX6.png"
 	}
 
@@ -3356,7 +3356,7 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 	itemList.List = specialList
 	itemList.ActivityTypeId = 7
 	itemList.ImgUrl = "https://hzstatic.hzinsights.com/static/temp/20220426202204/20220426/aYU8WLW0Pavj7JXm7DtjMMUe68Dg.png"
-	itemList.ImgUrlBg = "https://hzstatic.hzinsights.com/static/temp/20220426202204/20220426/Yzgq5wyMHxUi12w4kLRSLAfsBJGI.png"
+	itemList.ImgUrlBg = "https://hzstatic.hzinsights.com/static/temp/20220427202204/20220427/OkunjfKEgo5KRLifzwwLX8cDZnnN.png"
 	list = append(list, itemList)
 	//获取对应活动的数量并排序
 	intArr := make([]int, 0)

+ 6 - 5
models/activity.go

@@ -463,11 +463,12 @@ func UPdateActivityIdToSendFile(activityId int) (err error) {
 
 //活动详情
 type CygxActivityLabelList struct {
-	KeyWord     string `orm:"column(label)";description:"主题"`
-	Timesort    string `description:"最大时间"`
-	Mintimesort string `description:"最小时间"`
-	ImgUrlBg    string `description:"背景图片"`
-	ActivityId  int    `description:"活动ID "`
+	KeyWord           string `orm:"column(label)";description:"主题"`
+	Timesort          string `description:"最大时间"`
+	Mintimesort       string `description:"最小时间"`
+	ImgUrlBg          string `description:"背景图片"`
+	ActivityId        int    `description:"活动ID "`
+	IsShowSubjectName int    `description:"小程序内是否展示标的名称 1是 ,0否 默认0 "`
 }
 
 //主题列表

+ 11 - 0
services/activity.go

@@ -586,6 +586,17 @@ func LabelStr(label string) (labelNew string) {
 	return labelNew
 }
 
+//5.3版本活动标签字符串处理
+func LabelStrV5(label string, isShowSubjectName int) (labelNew string) {
+	slicebr := strings.Split(label, "-")
+	if len(slicebr) < 2 || isShowSubjectName == 0 {
+		labelNew = label
+	} else {
+		labelNew = slicebr[1]
+	}
+	return labelNew
+}
+
 func ActivityAttendanceDetail(cont context.Context) (err error) {
 	defer func() {
 		if err != nil {