Browse Source

微路演搜索处理

xingzai 2 năm trước cách đây
mục cha
commit
0f0cc0de0e

+ 58 - 33
controllers/micro_roadshow.go

@@ -53,53 +53,87 @@ func (this *MicroRoadShowController) List() {
 	activityVideoIds := this.GetString("ActivityVideoIds")
 	activityVideoId, _ := this.GetInt("ActivityVideoId")
 	filter, _ := this.GetInt("Filter", 0)
-
 	if pageSize <= 0 {
 		pageSize = utils.PageSize20
 	}
 	if currentIndex <= 0 {
 		currentIndex = 1
 	}
-
+	keyWordArr, err := services.GetIndustryMapNameSliceV3(keywords)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取分词失败,GetIndustryMapNameSliceV3 Err: " + err.Error()
+		return
+	}
+	keyWordArr = services.RemoveDuplicatesAndEmpty(keyWordArr)
+	var list []*models.MicroRoadShowPageList
+	var total int
+	var e error
 	// 微路演列表
-	list, total, e := services.GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activityVideoId, filter, keywords, audioIds, videoIds, activityVideoIds)
+	list, total, e = services.GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activityVideoId, filter, keywords, audioIds, videoIds, activityVideoIds)
 	if e != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
 		return
 	}
+	var pageSizeIk int
+	pageSizeIk = pageSize - len(list)
+	//获取总的数量
+	totalIk, e := services.CountMicroRoadShowPageListIkWord(audioId, videoId, activityVideoId, filter, keyWordArr, audioIds, videoIds, activityVideoIds)
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取微路演联想词列表失败, Err: " + e.Error()
+		return
+	}
+	//处理IK分词部分的分页获取条数
+	startSizeIk := utils.StartIndex(currentIndex, pageSize)
+	startSizeIk = startSizeIk - total
+
+	if pageSizeIk > 0 {
+		lisIk, e := services.GetMicroRoadShowPageListIkWord(startSizeIk, pageSizeIk, audioId, videoId, activityVideoId, filter, keyWordArr, audioIds, videoIds, activityVideoIds)
+		if e != nil {
+			br.Msg = "获取失败"
+			br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
+			return
+		}
+		for _, item := range lisIk {
+			list = append(list, item)
+		}
+	}
+	total = totalIk
+	userId := user.UserId
+	listMycollect, err := models.GetUserMicroRoadshowCollectList(userId)
+	if err != nil {
+		br.Msg = "获取数据失败"
+		br.ErrMsg = "获取数据失败,Err:" + err.Error()
+		return
+	}
+	mapaudioIds := make(map[int]int)         //活动音频
+	mapvideoIds := make(map[int]int)         // 微路演视频
+	mapactivityVideoIds := make(map[int]int) // 活动视频
+	for _, item := range listMycollect {
+		if item.ActivityVoiceId > 0 {
+			mapaudioIds[item.ActivityVoiceId] = item.ActivityVoiceId
+		} else if item.VideoId > 0 {
+			mapvideoIds[item.VideoId] = item.VideoId
+		} else if item.ActivityVideoId > 0 {
+			mapactivityVideoIds[item.ActivityVoiceId] = item.ActivityVoiceId
+		}
+	}
 	for _, item := range list {
 		if item.Type == 1 {
 			//音频
-			count, err := models.GetVoiceCollectCount(user.UserId, item.Id)
-			if err != nil {
-				br.Msg = "获取数据失败!"
-				br.ErrMsg = "获取数据失败,Err:" + err.Error()
-				return
-			}
-			if count > 0 {
+			if mapaudioIds[item.Id] > 0 {
 				item.IsCollect = true
 			}
 		} else if item.Type == 2 {
 			//活动视频
-			count, err := models.GetActivityVideoCollectCount(user.UserId, item.Id)
-			if err != nil {
-				br.Msg = "获取数据失败!"
-				br.ErrMsg = "获取数据失败,Err:" + err.Error()
-				return
-			}
-			if count > 0 {
+			if mapactivityVideoIds[item.Id] > 0 {
 				item.IsCollect = true
 			}
 		} else if item.Type == 3 {
 			//微路演视频
-			count, err := models.GetVideoCollectCount(user.UserId, item.Id)
-			if err != nil {
-				br.Msg = "获取数据失败!"
-				br.ErrMsg = "获取数据失败,Err:" + err.Error()
-				return
-			}
-			if count > 0 {
+			if mapvideoIds[item.Id] > 0 {
 				item.IsCollect = true
 			}
 		}
@@ -111,7 +145,6 @@ func (this *MicroRoadShowController) List() {
 		br.ErrMsg = "获取用户权限失败, Err: " + e.Error()
 		return
 	}
-
 	// 获取默认图配置
 	audioMap, videoMap, audioShareMap, videoShareMap, e := services.GetMicroRoadShowDefaultImgConfig()
 	if e != nil {
@@ -119,7 +152,6 @@ func (this *MicroRoadShowController) List() {
 		br.ErrMsg = "获取微路演列表失败, Err: " + e.Error()
 		return
 	}
-
 	for i := range list {
 		// 权限
 		au := new(models.UserPermissionAuthInfo)
@@ -167,18 +199,11 @@ func (this *MicroRoadShowController) List() {
 				list[i].ShareImg = videoShareMap[list[i].ChartPermissionId]
 			}
 		}
-
-		//修改产业视频的标题
-		//if list[i].Type == 3 && list[i].IndustryName != "" {
-		//	list[i].Title = "5min" + "【" + list[i].IndustryName + "】" + "逻辑解析"
-		//}
 	}
-
 	resp := new(models.MicroRoadShowListResp)
 	page := paging.GetPaging(currentIndex, pageSize, total)
 	resp.List = list
 	resp.Paging = page
-
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"

+ 5 - 1
models/article.go

@@ -270,7 +270,11 @@ func GetArticleDetailTestById(articleId int) (item *ArticleDetail, err error) {
 
 func GetArticleAll() (item []*ArticleDetail, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT * FROM cygx_article WHERE is_summary=1 `
+	sql := `SELECT * FROM cygx_article WHERE article_id  IN (7667,
+5282,
+5215,
+4615,
+4902) `
 	_, err = o.Raw(sql).QueryRows(&item)
 	return
 }

+ 157 - 0
models/micro_roadshow.go

@@ -120,6 +120,163 @@ func GetMicroRoadShowVideoPageListV8(startSize, pageSize int, condition string,
 	return
 }
 
+// CountMicroRoadShowVideoPageList 获取微路演视频数量
+func CountMicroRoadShowVideoPageList(condition string, pars []interface{}, conditionAct string, parsAct []interface{}, conditionAudio string, parsAudio []interface{}) (total int, err error) {
+	o := orm.NewOrm()
+	var sql string
+	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,
+			share_img_url AS share_img,
+			"" as  activity_id
+		FROM
+			cygx_micro_roadshow_video 
+		WHERE
+			publish_status = 1 `
+	if condition != `` {
+		sql += condition
+	}
+	sql += `  UNION ALL `
+	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,
+			v.activity_id
+		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
+	}
+	sql += `  UNION ALL `
+	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,
+			a.activity_id 
+		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 publish_time DESC`
+	totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
+	err = o.Raw(totalSql, pars, parsAct, parsAudio).QueryRow(&total)
+	return
+}
+
+// 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) {
+	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,
+			share_img_url AS share_img,
+			"" as  activity_id
+		FROM
+			cygx_micro_roadshow_video 
+		WHERE
+			publish_status = 1 `
+		if condition != `` {
+			sql += condition
+		}
+	}
+	if audioId+videoId+activityVideoId == 0 && filter != 2 {
+		sql += `  UNION ALL `
+	}
+
+	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,
+			v.activity_id
+		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 `
+	}
+
+	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,
+			a.activity_id 
+		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 publish_time DESC`
+	sql += ` LIMIT ?,?`
+	_, err = o.Raw(sql, pars, parsAct, parsAudio, startSize, pageSize).QueryRows(&list)
+	return
+}
+
 type AddVideoHistoryReq struct {
 	VideoId     int `description:"视频ID"`
 	PlaySeconds int `description:"播放时长"`

+ 9 - 3
services/article.go

@@ -680,9 +680,15 @@ func GetArticleListByApi(cont context.Context) (err error) {
 	return
 }
 
-//func init() {
-//	HandleArticleListByApi(7801)
-//}
+func init122() {
+	allList, err := models.GetArticleAll()
+
+	fmt.Println(err)
+	for _, v := range allList {
+		HandleArticleListByApi(v.ArticleId)
+	}
+
+}
 
 //处理同步过来的文章
 func HandleArticleListByApi(artcleId int) (err error) {

+ 2 - 0
services/elastic.go

@@ -896,11 +896,13 @@ func EsArticleSearch(keyWord string, startSize, pageSize int, orderColumn string
 	client := utils.Client
 	keyWordArr, err := GetIndustryMapNameSliceV3(keyWord)
 	keyWordArr = RemoveDuplicatesAndEmpty(keyWordArr)
+	fmt.Println(keyWordArr)
 	keyWordLen := len(keyWordArr)
 	if keyWordLen <= 0 {
 		keyWordArr = append(keyWordArr, keyWord)
 		keyWordLen = len(keyWordArr)
 	}
+	fmt.Println(keyWordArr)
 	mustMap := make([]interface{}, 0)
 	shouldMap := make(map[string]interface{}, 0)
 	//shouldMapquery := make(map[string]interface{}, 0)

+ 28 - 4
services/elasticsearch.go

@@ -263,7 +263,7 @@ func SearchByKeyWordBack02(keyWord string) (result []*models.SearchItem, err err
 	return
 }
 
-func SearchByKeyWordBack(indexName,keyWord string,startSize, pageSize,userId int) (result []*models.SearchItem,total int, err error) {
+func SearchByKeyWordBack(indexName, keyWord string, startSize, pageSize, userId int) (result []*models.SearchItem, total int, err error) {
 	keyWordArr, err := GetIndustryMapNameSlice(keyWord)
 	if err != nil {
 		go utils.SendEmail(utils.APPNAME+" "+utils.RunMode+"异常提醒:", "GetIndustryMapNameSlice:"+err.Error(), utils.EmailSendToUsers)
@@ -292,18 +292,18 @@ func SearchByKeyWordBack(indexName,keyWord string,startSize, pageSize,userId int
 		highlight = highlight.PreTags("<font color='red'>").PostTags("</font>")
 		searchByMatch, err := client.Search(esIndex).Highlight(highlight).Size(pageSize).Query(boolquery).Do(context.Background())
 		if err != nil {
-			return result,0, err
+			return result, 0, err
 		}
 		if searchByMatch.Hits != nil {
 			for _, v := range searchByMatch.Hits.Hits {
 				articleJson, err := v.Source.MarshalJSON()
 				if err != nil {
-					return nil,0, err
+					return nil, 0, err
 				}
 				article := new(models.CygxArticle)
 				err = json.Unmarshal(articleJson, &article)
 				if err != nil {
-					return nil,0, err
+					return nil, 0, err
 				}
 				if _, ok := searchMap[article.ArticleId]; !ok {
 					searchItem := new(models.SearchItem)
@@ -397,6 +397,30 @@ func RemoveDuplicatesAndEmpty(a []string) (ret []string) {
 	return
 }
 
+//KeyWordArrSqlRegexp 预处理ik联想词的模糊查询语句
+func KeyWordArrSqlRegexp(a []string) (ret string) {
+	a_len := len(a)
+	for i := 0; i < a_len; i++ {
+		if i == 0 {
+			continue
+		}
+		ret += a[i] + "|"
+	}
+	ret = strings.TrimRight(ret, "|")
+	return
+}
+
+//KeyWordArrSqlRegexp 预处理ik联想词的模糊查询语句
+func KeyWordArrSqlRegexpAll(a []string) (ret string) {
+	a_len := len(a)
+	for i := 0; i < a_len; i++ {
+		ret += a[i] + "|"
+	}
+	ret = strings.TrimRight(ret, "|")
+	//ret = "'" + ret + "'"
+	return
+}
+
 func init21123() {
 	fmt.Println("start")
 	client, err := elastic.NewClient(elastic.SetURL(ES_URL), elastic.SetBasicAuth(ES_USERNAME, ES_PASSWORD), elastic.SetSniff(false))

+ 189 - 9
services/micro_roadshow.go

@@ -3,7 +3,6 @@ package services
 import (
 	"encoding/json"
 	"errors"
-	"fmt"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/utils"
 	"strings"
@@ -177,9 +176,7 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 	var audioCond string
 	var audioPars []interface{}
 	// 如果筛选条件为指定视频ID或只看视频则不做音频查询
-	fmt.Println("filter:", filter)
 	if videoId > 0 || activityVideoId > 0 || filter == 1 {
-		fmt.Println("11111")
 		audioCond = ""
 	} else {
 		// 活动已发布且已结束
@@ -212,7 +209,6 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 	var videoPars []interface{}
 	var videoParsAct []interface{}
 	if audioId > 0 || filter == 2 {
-		fmt.Println("22222")
 		videoCond = ""
 	} else {
 		if keywords != "" {
@@ -246,11 +242,6 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 		if activityVideoId > 0 {
 			videoCond += ` AND video_id = 0 `
 		}
-		//if videoId == 0 {
-		//	endTime := time.Now().AddDate(0, 0, -30).Format("2006-01-02 15:04:05")
-		//	videoCondAct += ` AND art.activity_time > ? `
-		//	videoParsAct = append(videoParsAct, endTime)
-		//}
 		if videoIds != "" {
 			sliceId := strings.Split(videoIds, ",")
 			var idSqlStr string
@@ -271,6 +262,195 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 	return
 }
 
+// GetMicroRoadShowPageListIkWord  添加IK分词联想词 获取微路演列表添加活动视频 更新与8.1版本
+func CountMicroRoadShowPageListIkWord(audioId, videoId, activityVideoId, filter int, keywordArr []string, audioIds, videoIds, activityVideoIds string) (total int, err error) {
+	var e error
+	var keywords string
+	if len(keywordArr) > 1 {
+		keywords = KeyWordArrSqlRegexpAll(keywordArr)
+	}
+	//音频的查询
+	var audioCond string
+	var audioPars []interface{}
+	// 如果筛选条件为指定视频ID或只看视频则不做音频查询
+	if videoId > 0 || activityVideoId > 0 || filter == 1 {
+		audioCond += ` AND a.activity_voice_id  = 0 `
+	} else {
+		// 活动已发布且已结束
+		audioCond += ` AND b.publish_status = 1 AND b.active_state = 3`
+		if keywords != "" {
+			audioCond += ` AND a.voice_name REGEXP ? OR b.label REGEXP ?`
+			audioPars = append(audioPars, keywords, keywords)
+		}
+		if audioId > 0 {
+			audioCond += ` AND a.activity_voice_id = ?`
+			audioPars = append(audioPars, audioId)
+		}
+		if audioIds != "" {
+			sliceId := strings.Split(audioIds, ",")
+			var idSqlStr string
+			for _, v := range sliceId {
+				idSqlStr += "'" + v + "',"
+			}
+			idSqlStr = strings.TrimRight(idSqlStr, ",")
+			audioCond += ` AND a.activity_voice_id IN (` + idSqlStr + `)`
+		}
+	}
+	//视频的处理
+	var videoCond string
+	var videoCondAct string
+	var videoPars []interface{}
+	var videoParsAct []interface{}
+	if audioId > 0 || filter == 2 {
+		videoCond = ""
+	} else {
+		if keywords != "" {
+			videoCond += ` AND video_name REGEXP ?`
+			videoPars = append(videoPars, keywords)
+			videoCondAct += ` AND video_name REGEXP ?`
+			videoParsAct = append(videoParsAct, keywords)
+		}
+		if videoId > 0 {
+			videoCond += ` AND video_id = ?`
+			videoPars = append(videoPars, videoId)
+		}
+		if activityVideoId > 0 {
+			videoCondAct += ` AND video_id = ?`
+			videoParsAct = append(videoParsAct, activityVideoId)
+		}
+		if activityVideoIds != "" {
+			sliceId := strings.Split(activityVideoIds, ",")
+			var idSqlStr string
+			for _, v := range sliceId {
+				idSqlStr += "'" + v + "',"
+			}
+			idSqlStr = strings.TrimRight(idSqlStr, ",")
+			videoCondAct += ` AND v.video_id IN (` + idSqlStr + `)`
+		}
+
+		//如果传了路演的或者活动的视频ID只查询一个
+		if videoId > 0 {
+			videoCondAct += ` AND video_id = 0 `
+		}
+		if activityVideoId > 0 {
+			videoCond += ` AND video_id = 0 `
+		}
+
+		if videoIds != "" {
+			sliceId := strings.Split(videoIds, ",")
+			var idSqlStr string
+			for _, v := range sliceId {
+				idSqlStr += "'" + v + "',"
+			}
+			idSqlStr = strings.TrimRight(idSqlStr, ",")
+			videoCond += ` AND video_id IN (` + idSqlStr + `)`
+		}
+		videoCond += ` AND publish_status = 1`
+	}
+	total, e = models.CountMicroRoadShowVideoPageList(videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars)
+	if e != nil {
+		err = errors.New("获取微路演音视频列表失败, Err: " + e.Error())
+		return
+	}
+	return
+}
+
+// GetMicroRoadShowPageListIkWord  添加IK分词联想词 获取微路演列表添加活动视频 更新与8.1版本
+func GetMicroRoadShowPageListIkWord(startSize, pageSize, audioId, videoId, activityVideoId, filter int, keywordArr []string, audioIds, videoIds, activityVideoIds string) (respList []*models.MicroRoadShowPageList, err error) {
+
+	videoList := make([]*models.MicroRoadShowPageList, 0)
+	var e error
+	var keywords string
+	if len(keywordArr) > 1 {
+		keywords = KeyWordArrSqlRegexp(keywordArr)
+	}
+	//音频的查询
+	var audioCond string
+	var audioPars []interface{}
+	// 如果筛选条件为指定视频ID或只看视频则不做音频查询
+	if videoId > 0 || activityVideoId > 0 || filter == 1 {
+		audioCond += ` AND a.activity_voice_id  = 0 `
+	} else {
+		// 活动已发布且已结束
+		audioCond += ` AND b.publish_status = 1 AND b.active_state = 3`
+		if keywords != "" {
+			audioCond += ` AND a.voice_name REGEXP ? OR b.label REGEXP ?`
+			audioPars = append(audioPars, keywords, keywords)
+		}
+		if audioId > 0 {
+			audioCond += ` AND a.activity_voice_id = ?`
+			audioPars = append(audioPars, audioId)
+		}
+		if audioIds != "" {
+			sliceId := strings.Split(audioIds, ",")
+			var idSqlStr string
+			for _, v := range sliceId {
+				idSqlStr += "'" + v + "',"
+			}
+			idSqlStr = strings.TrimRight(idSqlStr, ",")
+			audioCond += ` AND a.activity_voice_id IN (` + idSqlStr + `)`
+		}
+	}
+	//视频的处理
+	var videoCond string
+	var videoCondAct string
+	var videoPars []interface{}
+	var videoParsAct []interface{}
+	if audioId > 0 || filter == 2 {
+		videoCond = ""
+	} else {
+		if keywords != "" {
+			videoCond += ` AND video_name REGEXP ?`
+			videoPars = append(videoPars, keywords)
+			videoCondAct += ` AND video_name REGEXP ?`
+			videoParsAct = append(videoParsAct, keywords)
+		}
+		if videoId > 0 {
+			videoCond += ` AND video_id = ?`
+			videoPars = append(videoPars, videoId)
+		}
+		if activityVideoId > 0 {
+			videoCondAct += ` AND video_id = ?`
+			videoParsAct = append(videoParsAct, activityVideoId)
+		}
+		if activityVideoIds != "" {
+			sliceId := strings.Split(activityVideoIds, ",")
+			var idSqlStr string
+			for _, v := range sliceId {
+				idSqlStr += "'" + v + "',"
+			}
+			idSqlStr = strings.TrimRight(idSqlStr, ",")
+			videoCondAct += ` AND v.video_id IN (` + idSqlStr + `)`
+		}
+
+		//如果传了路演的或者活动的视频ID只查询一个
+		if videoId > 0 {
+			videoCondAct += ` AND video_id = 0 `
+		}
+		if activityVideoId > 0 {
+			videoCond += ` AND video_id = 0 `
+		}
+
+		if videoIds != "" {
+			sliceId := strings.Split(videoIds, ",")
+			var idSqlStr string
+			for _, v := range sliceId {
+				idSqlStr += "'" + v + "',"
+			}
+			idSqlStr = strings.TrimRight(idSqlStr, ",")
+			videoCond += ` AND video_id IN (` + idSqlStr + `)`
+		}
+		videoCond += ` AND publish_status = 1`
+	}
+	videoList, e = models.GetMicroRoadShowVideoPageListIkWord(startSize, pageSize, videoCond, videoPars, videoCondAct, videoParsAct, audioCond, audioPars, audioId, videoId, activityVideoId, filter)
+	if e != nil {
+		err = errors.New("获取微路演音视频列表失败分词, Err: " + e.Error())
+		return
+	}
+	respList = videoList
+	return
+}
+
 // 我的收藏
 func GetMicroRoadShowMycollect(pageSize, currentIndex int, audioIds, videoIds, activityVideoIds string) (respList []*models.MicroRoadShowPageList, total int, err error) {
 	var e error