Răsfoiți Sursa

Merge branch 'master' of http://8.136.199.33:3000/hongze/hongze_cygx into cygx_7.2_yidongapi

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

+ 4 - 4
controllers/activity.go

@@ -3337,7 +3337,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
@@ -3382,7 +3382,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"
 		}
 
@@ -4321,7 +4321,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
@@ -4365,7 +4365,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

@@ -596,12 +596,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

+ 6 - 3
services/activity.go

@@ -739,7 +739,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 {
@@ -750,6 +750,9 @@ func LabelStrV5(label string, isShowSubjectName int) (labelNew string) {
 	} else {
 		labelNew = label
 	}
+	if temporaryLabel != "" {
+		labelNew = temporaryLabel
+	}
 	return labelNew
 }
 
@@ -1296,8 +1299,8 @@ func DoActivityOnenIdWxTemplateMsg(cont context.Context) (err error) {
 		return err
 	}
 	first := "近期所有行业活动预告,欢迎参与"
-	keyword1 := "--"
-	keyword2 := "--"
+	keyword1 := "下周活动预告"
+	keyword2 := "已发布"
 	keyword3 := ""
 	keyword4 := "点击查看下周活动列表"
 	SendActivityOnenIdWxTemplateMsg(first, keyword1, keyword2, keyword3, keyword4, openidPowerList)

+ 1 - 1
services/article.go

@@ -739,7 +739,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
 		listAuthor = append(listAuthor, itemAuthor)
 	} else {
 		// 如果这篇文章没有发布,那么就不作处理。
-		err = models.UpdateArticlePublish(0, artcleId)
+		err = models.UpdateArticlePublish(artcleId, 0)
 		if err != nil {
 			fmt.Println("UpdateArticlePublish Err:", err.Error())
 			return err