Browse Source

Merge branch 'cygx_12.7' of http://8.136.199.33:3000/cxzhang/hongze_clpt

xingzai 1 year ago
parent
commit
a88a5df537
3 changed files with 47 additions and 1 deletions
  1. 7 1
      models/micro_roadshow.go
  2. 34 0
      services/micro_roadshow.go
  3. 6 0
      services/user.go

+ 7 - 1
models/micro_roadshow.go

@@ -40,6 +40,8 @@ type MicroRoadShowPageList struct {
 	Title                  string    `description:"标题"`
 	ResourceUrl            string    `description:"链接"`
 	Type                   int       `description:"类型: 1-音频; 2-活动视频; 3-产业视频 、 4-系列问答视频"`
+	LabelType              int       `description:"标签类型: 1-路演回放; 2-调研反馈; 3-产业视频; 4-问答系列"`
+	ActivityFileType       int       `description:"活动音视频文件类型: 1-路演回放; 2-调研反馈"`
 	PublishTime            string    `description:"发布时间"`
 	BackgroundImg          string    `description:"背景图"`
 	ShareImg               string    `description:"分享封面图"`
@@ -344,6 +346,7 @@ func GetMicroRoadShowVideoPageListV12(startSize, pageSize int, audioAct string,
 			"" AS industry_name,
 			0 AS  industry_id,
 			a.share_img,
+			a.file_type as activity_file_type,
 			a.activity_id 
 		FROM
 			cygx_activity_voice AS a
@@ -364,11 +367,12 @@ func GetMicroRoadShowVideoPageListV12(startSize, pageSize int, audioAct string,
 	    	b.activity_time as publish_time,
 			b.chart_permission_id,
 			b.chart_permission_name,
-			"" AS play_seconds,
+			a.video_duration AS play_seconds,
 			a.background_img,
 			"" AS industry_name,
 			0 AS  industry_id,
 			a.share_img,
+			a.file_type as activity_file_type,
 			a.activity_id
 		FROM
 			cygx_activity_video as a
@@ -393,6 +397,7 @@ func GetMicroRoadShowVideoPageListV12(startSize, pageSize int, audioAct string,
 			industry_name,
 			industry_id,
 			share_img_url AS share_img,
+			'' as activity_file_type,
 			"" as  activity_id
 		FROM
 			cygx_micro_roadshow_video  as a
@@ -419,6 +424,7 @@ func GetMicroRoadShowVideoPageListV12(startSize, pageSize int, audioAct string,
 			"" AS industry_name,
 			0 AS  industry_id,
 			a.share_img,
+			'' as activity_file_type,
 			0  as activity_id 
 		FROM
 			cygx_askserie_video AS a WHERE 1= 1 `

+ 34 - 0
services/micro_roadshow.go

@@ -420,6 +420,12 @@ func GetMicroRoadShowPageListV12(pageSize, currentIndex, sourceId, tableType int
 		err = errors.New("获取微路演音视频列表失败, Err: " + e.Error())
 		return
 	}
+	for _, v := range videoList {
+		v.LabelType = v.Type
+		if v.Type == 1 || v.Type == 2 {
+			v.LabelType = v.ActivityFileType
+		}
+	}
 	respList = videoList
 	return
 }
@@ -844,3 +850,31 @@ func AddAllCygxVoiceAndVideoHistory(user *models.WxUserItem, sourceId, sourceTyp
 	}
 	return
 }
+
+// 获取满足路演回放的活动类型
+func GetActivityLYHFMapByActivityIds(activityIds []int) (mapResp map[int]bool) {
+	var err error
+	defer func() {
+		if err != nil {
+			go utils.SendAlarmMsg("获取满足路演回放的活动类型 GetActivityLYHFMapByActivityIds,失败,活动ID:"+fmt.Sprint(activityIds)+err.Error(), 2)
+		}
+	}()
+	var condition string
+	var pars []interface{}
+	lenArr := len(activityIds)
+	if lenArr == 0 {
+		return
+	}
+	condition = ` AND activity_id IN (` + utils.GetOrmInReplace(lenArr) + `)  `
+	pars = append(pars, activityIds)
+	list, e := models.GetActivityListByCondition(condition, pars)
+	if e != nil {
+		err = errors.New("GetIndustrialManagementNewList, Err: " + e.Error())
+		return
+	}
+	mapResp = make(map[int]bool, 0)
+	for _, v := range list {
+		mapResp[v.ActivityId] = true
+	}
+	return
+}

+ 6 - 0
services/user.go

@@ -638,6 +638,12 @@ func GetMicroRoadShowMycollectV12(pageSize, currentIndex int, audioIds, activity
 			}
 		}
 	}
+	for _, v := range videoList {
+		v.LabelType = v.Type
+		if v.Type == 1 || v.Type == 2 {
+			v.LabelType = v.ActivityFileType
+		}
+	}
 	respList = videoList
 	return
 }