|
@@ -630,3 +630,59 @@ type MicroRoadshowCollectReq struct {
|
|
|
SourceId int `description:"资源ID"`
|
|
|
SourceType int `description:"视频来源: 1-音频; 2-活动视频; 3-微路演视频 (不传默认为1)"`
|
|
|
}
|
|
|
+
|
|
|
+func GetMicroRoadShowVideoPageListByActivityIds(activityIds []int) (list []*MicroRoadShowPageList, err error) {
|
|
|
+ lenArr := len(activityIds)
|
|
|
+ if lenArr == 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ o := orm.NewOrm()
|
|
|
+ var sql string
|
|
|
+ //活动音频1
|
|
|
+ sql += `
|
|
|
+ SELECT
|
|
|
+ a.activity_voice_id AS id,
|
|
|
+ a.activity_id AS source_id,
|
|
|
+ a.voice_name AS title,
|
|
|
+ a.voice_url AS resource_url,
|
|
|
+ 1 AS type,
|
|
|
+ b.activity_time AS publish_time,
|
|
|
+ b.chart_permission_id,
|
|
|
+ b.chart_permission_name,
|
|
|
+ a.voice_play_seconds 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_voice AS a
|
|
|
+ JOIN cygx_activity AS b ON a.activity_id = b.activity_id WHERE 1= 1 AND a.activity_id IN (` + utils.GetOrmInReplace(lenArr) + `) `
|
|
|
+
|
|
|
+ //活动视频2
|
|
|
+ sql += ` UNION ALL `
|
|
|
+ sql += `
|
|
|
+ SELECT
|
|
|
+ a.video_id AS id,
|
|
|
+ a.activity_id AS source_id,
|
|
|
+ a.video_name AS title,
|
|
|
+ a.video_url AS resource_url,
|
|
|
+ 2 AS type,
|
|
|
+ b.activity_time as publish_time,
|
|
|
+ b.chart_permission_id,
|
|
|
+ b.chart_permission_name,
|
|
|
+ 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
|
|
|
+ INNER JOIN cygx_activity as b on a.activity_id = b.activity_id WHERE 1= 1 AND a.activity_id IN (` + utils.GetOrmInReplace(lenArr) + `) `
|
|
|
+ sql += ` ORDER BY publish_time DESC`
|
|
|
+ _, err = o.Raw(sql, activityIds, activityIds).QueryRows(&list)
|
|
|
+ return
|
|
|
+}
|