|
@@ -15,21 +15,22 @@ type MicroRoadShowListResp struct {
|
|
|
|
|
|
// MicroRoadShowPageList 微路演列表
|
|
|
type MicroRoadShowPageList struct {
|
|
|
- Id int `description:"音视频ID"`
|
|
|
- Title string `description:"标题"`
|
|
|
- ResourceUrl string `description:"链接"`
|
|
|
- Type int `description:"类型: 1-音频; 2-活动视频; 3-产业视频"`
|
|
|
- PublishTime string `description:"发布时间"`
|
|
|
- BackgroundImg string `description:"背景图"`
|
|
|
- ShareImg string `description:"分享封面图"`
|
|
|
- ChartPermissionId int `description:"行业ID"`
|
|
|
- ChartPermissionName string `description:"行业名称"`
|
|
|
- IndustryName string `description:"产业名称"`
|
|
|
- PlaySeconds string `description:"音视频时长"`
|
|
|
- ActivityId int `description:"活动ID"`
|
|
|
- IsCollect bool `description:"是否收藏"`
|
|
|
- IndustrialManagementId int `description:"产业ID"`
|
|
|
- CreateTime string `description:"视频创建时间"`
|
|
|
+ Id int `description:"音视频ID"`
|
|
|
+ Title string `description:"标题"`
|
|
|
+ ResourceUrl string `description:"链接"`
|
|
|
+ Type int `description:"类型: 1-音频; 2-活动视频; 3-产业视频"`
|
|
|
+ PublishTime string `description:"发布时间"`
|
|
|
+ BackgroundImg string `description:"背景图"`
|
|
|
+ ShareImg string `description:"分享封面图"`
|
|
|
+ ChartPermissionId int `description:"行业ID"`
|
|
|
+ ChartPermissionName string `description:"行业名称"`
|
|
|
+ IndustryName string `description:"产业名称"`
|
|
|
+ PlaySeconds string `description:"音视频时长"`
|
|
|
+ ActivityId int `description:"活动ID"`
|
|
|
+ IsCollect bool `description:"是否收藏"`
|
|
|
+ IndustrialManagementId int `description:"产业ID"`
|
|
|
+ CreateTime string `description:"视频创建时间"`
|
|
|
+ CollectTime time.Time `description:"收藏时间"`
|
|
|
AuthInfo *UserPermissionAuthInfo
|
|
|
}
|
|
|
|
|
@@ -291,98 +292,16 @@ func GetMicroRoadShowVideoPageListV8(startSize, pageSize int, condition string,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetMicroRoadShowVideoPageList 获取微路演视频列表-分页 收藏用-更改排序字段
|
|
|
-func GetMicroRoadShowVideoPageListV9(startSize, pageSize int, condition string, pars []interface{}, conditionAct string, parsAct []interface{}, conditionAudio string, parsAudio []interface{}, audioId, videoId, activityVideoId, filter int) (total int, list []*MicroRoadShowPageList, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- var sql string
|
|
|
- //if audioId+activityVideoId == 0 && filter != 2 {
|
|
|
- sql += `SELECT
|
|
|
- video_id AS id,
|
|
|
- video_name AS title,
|
|
|
- video_url AS resource_url,
|
|
|
- 3 AS type,
|
|
|
- publish_date AS publish_time,
|
|
|
- chart_permission_id,
|
|
|
- chart_permission_name,
|
|
|
- video_duration AS play_seconds,
|
|
|
- img_url AS background_img,
|
|
|
- industry_name,
|
|
|
+type MicroList []*MicroRoadShowPageList
|
|
|
|
|
|
- share_img_url AS share_img,
|
|
|
- industry_id AS industrial_management_id,
|
|
|
- "" as activity_id,
|
|
|
- create_time
|
|
|
- FROM
|
|
|
- cygx_micro_roadshow_video
|
|
|
- WHERE
|
|
|
- publish_status = 1 `
|
|
|
- if condition != `` {
|
|
|
- sql += condition
|
|
|
- }
|
|
|
- //}
|
|
|
- //if audioId+videoId+activityVideoId == 0 && filter != 2 {
|
|
|
- sql += ` UNION ALL `
|
|
|
- //}
|
|
|
+func (m MicroList) Len() int {
|
|
|
+ return len(m)
|
|
|
+}
|
|
|
|
|
|
- //if audioId+videoId == 0 && filter != 2 {
|
|
|
- sql += `
|
|
|
- SELECT
|
|
|
- video_id AS id,
|
|
|
- video_name AS title,
|
|
|
- video_url AS resource_url,
|
|
|
- 2 AS type,
|
|
|
- art.activity_time as publish_time,
|
|
|
- art.chart_permission_id,
|
|
|
- art.chart_permission_name,
|
|
|
- "" AS play_seconds,
|
|
|
- "" AS background_img,
|
|
|
- "" AS industry_name,
|
|
|
- "" AS share_img,
|
|
|
- 0 AS industrial_management_id,
|
|
|
- v.activity_id,
|
|
|
- v.create_time
|
|
|
- FROM
|
|
|
- cygx_activity_video as v
|
|
|
- INNER JOIN cygx_activity as art on art.activity_id = v.activity_id WHERE 1= 1 `
|
|
|
- if conditionAct != `` {
|
|
|
- sql += conditionAct
|
|
|
- }
|
|
|
- //}
|
|
|
- //if audioId+videoId+activityVideoId == 0 && filter == 0 {
|
|
|
- sql += ` UNION ALL `
|
|
|
- //}
|
|
|
+func (m MicroList) Less(i, j int) bool {
|
|
|
+ return m[i].CollectTime.After(m[j].CollectTime)
|
|
|
+}
|
|
|
|
|
|
- //if videoId+activityVideoId == 0 && filter != 1 {
|
|
|
- sql += `
|
|
|
- SELECT
|
|
|
- a.activity_voice_id AS 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.img_url AS background_img,
|
|
|
- "" AS industry_name,
|
|
|
- "" AS share_img,
|
|
|
- 0 AS industrial_management_id,
|
|
|
- a.activity_id,
|
|
|
- a.create_time
|
|
|
- FROM
|
|
|
- cygx_activity_voice AS a
|
|
|
- JOIN cygx_activity AS b ON a.activity_id = b.activity_id WHERE 1= 1 `
|
|
|
- if conditionAudio != `` {
|
|
|
- sql += conditionAudio
|
|
|
- }
|
|
|
- //}
|
|
|
- sql += ` ORDER BY create_time DESC`
|
|
|
- totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
|
|
|
- err = o.Raw(totalSql, pars, parsAct, parsAudio).QueryRow(&total)
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
- }
|
|
|
- sql += ` LIMIT ?,?`
|
|
|
- _, err = o.Raw(sql, pars, parsAct, parsAudio, startSize, pageSize).QueryRows(&list)
|
|
|
- return
|
|
|
-}
|
|
|
+func (m MicroList) Swap(i, j int) {
|
|
|
+ m[i], m[j] = m[j], m[i]
|
|
|
+}
|