Browse Source

活动首页,标签展示

xingzai 2 years ago
parent
commit
5be484655a
3 changed files with 14 additions and 2 deletions
  1. 4 0
      controllers/activity.go
  2. 5 2
      models/activity.go
  3. 5 0
      services/activity_special.go

+ 4 - 0
controllers/activity.go

@@ -12,6 +12,7 @@ import (
 	"strconv"
 	"strings"
 	"time"
+	"unicode/utf8"
 )
 
 //活动
@@ -3120,6 +3121,9 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 			if v2.YidongActivityId != 0 {
 				v2.IsExternalLabel = true
 			}
+			if utf8.RuneCountInString(v2.City) != 2 {
+				labelList[k2].City = ""
+			}
 			labelList[k2].KeyWord = services.LabelStrV5(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
 			labelList[k2].ImgUrlBg = v.ImgUrlBgs
 		}

+ 5 - 2
models/activity.go

@@ -697,12 +697,15 @@ type CygxActivityLabelList struct {
 	IsNew             bool   `description:"是否为新:活动存在关联的的产业所关联的报告均在3个月内/无报告则标记新"`
 	YidongActivityId  int    `description:"易董活动ID"`
 	IsExternalLabel   bool   `description:"是否为外部资源"`
+	TripStatus        int    `description:"行程进行状态 1:预报名,2:确定行程"`
+	City              string `description:"城市"`
+	Days              int    `description:"天数"`
 }
 
 //主题列表
 func GetActivityLabelListAll(condition, sortTime string, pars []interface{}, startSize, pageSize int) (items []*CygxActivityLabelList, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT	activity_id, label,temporary_label,is_show_subject_name, MAX( art.activity_time ) AS timesort, MIn( art.activity_time ) AS mintimesort , yidong_activity_id 
+	sql := `SELECT	activity_id, label,temporary_label,is_show_subject_name, MAX( art.activity_time ) AS timesort, MIn( art.activity_time ) AS mintimesort , yidong_activity_id,city
 		FROM cygx_activity as art WHERE 1= 1 `
 	if condition != "" {
 		sql += condition
@@ -795,7 +798,7 @@ func GetAskEmail() (item []*AskEmailRep, err error) {
 //主题列表
 func GetActivityLabelSpecialListAll(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxActivityLabelList, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT	label,activity_id,is_show_subject_name
+	sql := `SELECT	label,activity_id,is_show_subject_name,days
 		FROM cygx_activity_special as art WHERE 1= 1 `
 	if condition != "" {
 		sql += condition

+ 5 - 0
services/activity_special.go

@@ -137,6 +137,11 @@ func GetActivityLabelSpecialList(user *models.WxUserItem, isPower int, chartPerm
 	}
 	//}
 	for k2, v2 := range specialList {
+		if v2.Days == 0 {
+			specialList[k2].TripStatus = 1
+		} else {
+			specialList[k2].TripStatus = 2
+		}
 		specialList[k2].KeyWord = LabelStrV5(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
 		specialList[k2].ImgUrlBg = "https://hzstatic.hzinsights.com/static/temp/20220426202204/20220426/XDLLsjC9XAAy8LIzQr7GsjrBbtX6.png"
 		specialList[k2].ImgUrlBg = utils.ACTIVITY_ZXDY_ImgUrl3