Browse Source

no message

xingzai 1 year ago
parent
commit
df80e7c565

+ 4 - 4
controllers/micro_roadshow.go

@@ -27,7 +27,7 @@ type MicroRoadShowController struct {
 // @Param   ActivityVideoIds	query	string		false	"活动视频IDs"
 // @Param   VideoIds			query	string		false	"视频IDs"
 // @Param   ActivityVideoId			query	int		false	"活动视频ID"
-// @Param   Filter			query	int		false	"筛选条件 0:全部 1:视频 2:音频"
+// @Param   Filter			query	string		false	"筛选条件 为空:全部 1:视频 2:音频 3:逻辑解析 4:路演回放 多个用 , 隔开"
 // @Success 200 {object} models.HomeListResp
 // @router /list [get]
 func (this *MicroRoadShowController) List() {
@@ -52,7 +52,7 @@ func (this *MicroRoadShowController) List() {
 	videoIds := this.GetString("VideoIds")
 	activityVideoIds := this.GetString("ActivityVideoIds")
 	activityVideoId, _ := this.GetInt("ActivityVideoId")
-	filter, _ := this.GetInt("Filter", 0)
+	filter := this.GetString("Filter")
 	if pageSize <= 0 {
 		pageSize = utils.PageSize20
 	}
@@ -83,7 +83,7 @@ func (this *MicroRoadShowController) List() {
 	if keywords != "" {
 		var pageSizeIk int
 		//获取总的数量
-		totalIk, e := services.CountMicroRoadShowPageListIkWord(audioId, videoId, activityVideoId, filter, keyWordArr, audioIds, videoIds, activityVideoIds)
+		totalIk, e := services.CountMicroRoadShowPageListIkWord(audioId, videoId, activityVideoId, keyWordArr, filter, audioIds, videoIds, activityVideoIds)
 		if e != nil {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取微路演联想词列表失败, Err: " + e.Error()
@@ -97,7 +97,7 @@ func (this *MicroRoadShowController) List() {
 			startSizeIk = 0
 		}
 		if pageSizeIk > 0 {
-			lisIk, e := services.GetMicroRoadShowPageListIkWord(startSizeIk, pageSizeIk, audioId, videoId, activityVideoId, filter, keyWordArr, audioIds, videoIds, activityVideoIds, keywords)
+			lisIk, e := services.GetMicroRoadShowPageListIkWord(startSizeIk, pageSizeIk, audioId, videoId, activityVideoId, keyWordArr, filter, audioIds, videoIds, activityVideoIds, keywords)
 			if e != nil {
 				br.Msg = "获取失败"
 				br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()

+ 1 - 0
models/cygx_morning_meeting_gather.go

@@ -74,6 +74,7 @@ type CygxMorningMeetingGatherDetailListResp struct {
 	ChartPermissionId   int    `description:"行业id"` // 行业id
 	MeetingId           int    `description:"主表id"` // 主表id
 	Content             string `description:"内容"`   // 内容
+	PublishTime         string `description:"发布日期"`
 }
 
 type CygxMorningMeetingGatherDetailResp struct {

+ 1 - 1
models/cygx_morning_meeting_review_chapter.go

@@ -23,7 +23,7 @@ type CygxMorningMeetingReviewChapter struct {
 // 列表
 func GetCygxMorningMeetingReviewChapterList(condition string, pars []interface{}) (items []*CygxMorningMeetingGatherDetailListResp, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT c.*
+	sql := `SELECT c.*,r.publish_time
 			FROM cygx_morning_meeting_review_chapter  as  c 
 			INNER JOIN cygx_morning_meeting_reviews as r ON  r.id = c.meeting_id   WHERE 1 = 1  AND r.status = 1 `
 	if condition != "" {

+ 2 - 2
models/micro_roadshow.go

@@ -60,7 +60,7 @@ type MicroRoadShowPageList struct {
 }
 
 // GetMicroRoadShowVideoPageList 获取微路演视频列表-分页
-func GetMicroRoadShowVideoPageListV8(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) {
+func GetMicroRoadShowVideoPageListV8(startSize, pageSize int, condition string, pars []interface{}, conditionAct string, parsAct []interface{}, conditionAudio string, parsAudio []interface{}) (total int, list []*MicroRoadShowPageList, err error) {
 	o := orm.NewOrm()
 	var sql string
 	//if audioId+activityVideoId == 0 && filter != 2 {
@@ -222,7 +222,7 @@ func CountMicroRoadShowVideoPageList(condition string, pars []interface{}, condi
 }
 
 // GetMicroRoadShowVideoPageList 获取微路演视频列表-分页
-func GetMicroRoadShowVideoPageListIkWord(startSize, pageSize int, condition string, pars []interface{}, conditionAct string, parsAct []interface{}, conditionAudio string, parsAudio []interface{}, audioId, videoId, activityVideoId, filter int) (list []*MicroRoadShowPageList, err error) {
+func GetMicroRoadShowVideoPageListIkWord(startSize, pageSize int, condition string, pars []interface{}, conditionAct string, parsAct []interface{}, conditionAudio string, parsAudio []interface{}) (list []*MicroRoadShowPageList, err error) {
 	o := orm.NewOrm()
 	var sql string
 	//if audioId+activityVideoId == 0 && filter != 2 {

+ 35 - 12
services/micro_roadshow.go

@@ -165,7 +165,7 @@ func GetHomeNewestList(userId, companyId, startSize, pageSize int, condition str
 }
 
 // GetMicroRoadShowPageList 获取微路演列表添加活动视频 更新与8.1版本
-func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activityVideoId, filter int, keywords, audioIds, videoIds, activityVideoIds string) (respList []*models.MicroRoadShowPageList, total int, err error) {
+func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activityVideoId int, filter, keywords, audioIds, videoIds, activityVideoIds string) (respList []*models.MicroRoadShowPageList, total int, err error) {
 	var e error
 	// 根据每页数据量获取音视频配比
 	startSize := utils.StartIndex(currentIndex, pageSize)
@@ -250,12 +250,19 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 		videoCondAct += ` AND video_id = 0 `
 		videoCond += ` AND video_id = 0 `
 	}
-	if filter == 1 {
+	if strings.Contains(filter, "1") && !strings.Contains(filter, "2") {
 		audioCond += ` AND a.activity_voice_id = 0 `
-	} else if filter == 2 {
+	} else if !strings.Contains(filter, "1") && strings.Contains(filter, "2") {
 		videoCondAct += ` AND video_id = 0 `
 		videoCond += ` AND video_id = 0 `
 	}
+
+	if strings.Contains(filter, "3") && !strings.Contains(filter, "4") {
+		audioCond += ` AND a.activity_voice_id = 0 `
+		videoCondAct += ` AND video_id = 0 `
+	} else if strings.Contains(filter, "3") && !strings.Contains(filter, "4") {
+		videoCond += ` AND video_id = 0 `
+	}
 	if videoIds != "" {
 		sliceId := strings.Split(videoIds, ",")
 		var idSqlStr string
@@ -267,7 +274,7 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 	}
 	videoCond += ` AND publish_status = 1`
 	//}
-	total, videoList, e = models.GetMicroRoadShowVideoPageListV8(startSize, pageSize, videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars, audioId, videoId, activityVideoId, filter)
+	total, videoList, e = models.GetMicroRoadShowVideoPageListV8(startSize, pageSize, videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars)
 	if e != nil {
 		err = errors.New("获取微路演音视频列表失败, Err: " + e.Error())
 		return
@@ -277,7 +284,7 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 }
 
 // GetMicroRoadShowPageListIkWord  添加IK分词联想词 获取微路演列表添加活动视频 更新与8.1版本
-func CountMicroRoadShowPageListIkWord(audioId, videoId, activityVideoId, filter int, keywordArr []string, audioIds, videoIds, activityVideoIds string) (total int, err error) {
+func CountMicroRoadShowPageListIkWord(audioId, videoId, activityVideoId int, keywordArr []string, filter, audioIds, videoIds, activityVideoIds string) (total int, err error) {
 	var e error
 	var keywords string
 	if len(keywordArr) > 0 {
@@ -358,13 +365,21 @@ func CountMicroRoadShowPageListIkWord(audioId, videoId, activityVideoId, filter
 		videoCondAct += ` AND video_id = 0 `
 		videoCond += ` AND video_id = 0 `
 	}
-	if filter == 1 {
+
+	if strings.Contains(filter, "1") && !strings.Contains(filter, "2") {
 		audioCond += ` AND a.activity_voice_id = 0 `
-	} else if filter == 2 {
+	} else if !strings.Contains(filter, "1") && strings.Contains(filter, "2") {
 		videoCondAct += ` AND video_id = 0 `
 		videoCond += ` AND video_id = 0 `
 	}
 
+	if strings.Contains(filter, "3") && !strings.Contains(filter, "4") {
+		audioCond += ` AND a.activity_voice_id = 0 `
+		videoCondAct += ` AND video_id = 0 `
+	} else if strings.Contains(filter, "3") && !strings.Contains(filter, "4") {
+		videoCond += ` AND video_id = 0 `
+	}
+
 	if videoIds != "" {
 		sliceId := strings.Split(videoIds, ",")
 		var idSqlStr string
@@ -385,7 +400,7 @@ func CountMicroRoadShowPageListIkWord(audioId, videoId, activityVideoId, filter
 }
 
 // GetMicroRoadShowPageListIkWord  添加IK分词联想词 获取微路演列表添加活动视频 更新与8.1版本
-func GetMicroRoadShowPageListIkWord(startSize, pageSize, audioId, videoId, activityVideoId, filter int, keywordArr []string, audioIds, videoIds, activityVideoIds, keywords string) (respList []*models.MicroRoadShowPageList, err error) {
+func GetMicroRoadShowPageListIkWord(startSize, pageSize, audioId, videoId, activityVideoId int, keywordArr []string, filter, audioIds, videoIds, activityVideoIds, keywords string) (respList []*models.MicroRoadShowPageList, err error) {
 
 	videoList := make([]*models.MicroRoadShowPageList, 0)
 	var e error
@@ -473,10 +488,18 @@ func GetMicroRoadShowPageListIkWord(startSize, pageSize, audioId, videoId, activ
 		videoCondAct += ` AND video_id = 0 `
 		videoCond += ` AND video_id = 0 `
 	}
-	if filter == 1 {
+
+	if strings.Contains(filter, "1") && !strings.Contains(filter, "2") {
+		audioCond += ` AND a.activity_voice_id = 0 `
+	} else if !strings.Contains(filter, "1") && strings.Contains(filter, "2") {
+		videoCondAct += ` AND video_id = 0 `
+		videoCond += ` AND video_id = 0 `
+	}
+
+	if strings.Contains(filter, "3") && !strings.Contains(filter, "4") {
 		audioCond += ` AND a.activity_voice_id = 0 `
-	} else if filter == 2 {
 		videoCondAct += ` AND video_id = 0 `
+	} else if strings.Contains(filter, "3") && !strings.Contains(filter, "4") {
 		videoCond += ` AND video_id = 0 `
 	}
 
@@ -491,7 +514,7 @@ func GetMicroRoadShowPageListIkWord(startSize, pageSize, audioId, videoId, activ
 	}
 	videoCond += ` AND publish_status = 1`
 	//}
-	videoList, e = models.GetMicroRoadShowVideoPageListIkWord(startSize, pageSize, videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars, audioId, videoId, activityVideoId, filter)
+	videoList, e = models.GetMicroRoadShowVideoPageListIkWord(startSize, pageSize, videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars)
 	if e != nil {
 		err = errors.New("获取微路演音视频列表失败分词, Err: " + e.Error())
 		return
@@ -553,7 +576,7 @@ func GetMicroRoadShowMycollect(pageSize, currentIndex int, audioIds, videoIds, a
 	}
 	videoCond += ` AND publish_status = 1`
 
-	total, videoList, e = models.GetMicroRoadShowVideoPageListV8(startSize, pageSize, videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars, 0, 0, 0, 0)
+	total, videoList, e = models.GetMicroRoadShowVideoPageListV8(startSize, pageSize, videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars)
 	if e != nil {
 		err = errors.New("获取微路演音视频列表失败, Err: " + e.Error())
 		return

+ 3 - 0
services/resource_data.go

@@ -100,6 +100,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 			return
 		}
 		for _, v := range listrMeet {
+			v.PublishTime = utils.TimeRemoveHms2(v.PublishTime)
 			mapItems[fmt.Sprint("meetingreviewchapt", v.Id)].Meetingreviewchapt = v
 		}
 	}
@@ -116,6 +117,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 			return
 		}
 		for _, v := range listresearchsummary {
+			v.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
 			mapItems[fmt.Sprint("minutessummary", v.ArticleId)].Minutessummary = v
 		}
 	}
@@ -132,6 +134,7 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 			return
 		}
 		for _, v := range listresearchsummary {
+			v.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
 			mapItems[fmt.Sprint("researchsummary", v.ArticleId)].Researchsummary = v
 		}
 	}