Sfoglia il codice sorgente

Merge branch 'clpt_v3.0' of http://8.136.199.33:3000/cxzhang/hongze_clpt into debug

xingzai 2 anni fa
parent
commit
8d41314b76

+ 1 - 1
models/industrial_activity_group_management.go

@@ -76,7 +76,7 @@ func GetActivityIndustryRelationList(condition string, pars []interface{}) (list
 				cygx_activity AS a
 			JOIN cygx_industrial_activity_group_management AS b ON a.activity_id = b.activity_id
 			WHERE
-				1 = 1 `
+				1 = 1  AND b.source = 1 `
 	if condition != `` {
 		sql += condition
 	}

+ 17 - 13
models/micro_roadshow.go

@@ -15,19 +15,20 @@ 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"`
-	AuthInfo            *UserPermissionAuthInfo
+	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"`
+	IndustrialManagementId int    `description:"产业ID"`
+	AuthInfo               *UserPermissionAuthInfo
 }
 
 type AddVideoHistoryReq struct {
@@ -201,6 +202,7 @@ func GetMicroRoadShowVideoPageListV8(startSize, pageSize int, condition string,
 			img_url AS background_img,            
 			industry_name,
 			share_img_url AS share_img,
+			industry_id AS industrial_management_id,
 			"" as  activity_id
 		FROM
 			cygx_micro_roadshow_video 
@@ -228,6 +230,7 @@ func GetMicroRoadShowVideoPageListV8(startSize, pageSize int, condition string,
 			"" AS background_img,
 			"" AS industry_name,
 			"" AS share_img,
+			0 AS industrial_management_id,
 			v.activity_id
 		FROM
 			cygx_activity_video as v
@@ -254,6 +257,7 @@ func GetMicroRoadShowVideoPageListV8(startSize, pageSize int, condition string,
 			a.img_url AS background_img,
 			"" AS industry_name,
 			"" AS share_img,
+			0 AS industrial_management_id,
 			a.activity_id 
 		FROM
 			cygx_activity_voice AS a

+ 9 - 0
routers/commentsRouter.go

@@ -7,6 +7,15 @@ import (
 
 func init() {
 
+    beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ActivityController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ActivityController"],
+        beego.ControllerComments{
+            Method: "Detail",
+            Router: `/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ActivityController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ActivityController"],
         beego.ControllerComments{
             Method: "LabelTypeList",

+ 33 - 3
services/micro_roadshow.go

@@ -202,7 +202,7 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 	var audioPars []interface{}
 	// 如果筛选条件为指定视频ID或只看视频则不做音频查询
 	// @Param   Filter			query	string		false	"筛选条件 为空:全部 1:视频 2:音频 3:逻辑解析 4:路演回放 多个用 , 隔开"
-	if (videoId > 0 || activityVideoId > 0 || !strings.Contains(filter, "1") || !strings.Contains(filter, "4")) && filter != "" {
+	if (videoId > 0 || activityVideoId > 0 || (!strings.Contains(filter, "2") && !strings.Contains(filter, "4"))) && filter != "" {
 		audioCond += ` AND a.activity_voice_id = 0 `
 	} else {
 		// 活动已发布且已结束
@@ -224,7 +224,7 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 	//活动视频的处理
 	var videoCondAct string
 	var videoParsAct []interface{}
-	if (audioId > 0 || videoId > 0 || !strings.Contains(filter, "2") || !strings.Contains(filter, "4")) && filter != "" {
+	if (audioId > 0 || videoId > 0 || (!strings.Contains(filter, "1") && !strings.Contains(filter, "4"))) && filter != "" {
 		videoCondAct = "AND video_id =  0 "
 	} else {
 		if keywords != "" {
@@ -240,7 +240,7 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 	//产业视频的处理
 	var videoCond string
 	var videoPars []interface{}
-	if (audioId > 0 || videoId > 0 || !strings.Contains(filter, "2") || !strings.Contains(filter, "3")) && filter != "" {
+	if (audioId > 0 || videoId > 0 || (!strings.Contains(filter, "1") && !strings.Contains(filter, "3"))) && filter != "" {
 		videoCond += ` AND video_id =  0 `
 	} else {
 		if keywords != "" {
@@ -259,6 +259,36 @@ func GetMicroRoadShowPageListV8(pageSize, currentIndex, audioId, videoId, activi
 		err = errors.New("获取微路演音视频列表失败, Err: " + e.Error())
 		return
 	}
+	if total == 0 {
+		return
+	}
+	var activityIds []int
+	for _, v := range videoList {
+		if v.Type == 2 {
+			activityIds = append(activityIds, v.ActivityId)
+		}
+	}
+	if len(activityIds) > 0 {
+		// 获取活动关联的产业
+		var groupCond string
+		var groupPars []interface{}
+		groupCond += ` AND a.activity_id IN (` + utils.GetOrmInReplace(len(activityIds)) + `)`
+		groupPars = append(groupPars, activityIds)
+		groups, e := models.GetActivityIndustryRelationList(groupCond, groupPars)
+		if e != nil {
+			err = errors.New("获取活动产业关联列表失败, Err: " + e.Error())
+			return
+		}
+		activityIndustryMap := make(map[int]int, 0)
+		for _, v := range groups {
+			activityIndustryMap[v.ActivityId] = v.IndustrialManagementId
+		}
+		for _, v := range videoList {
+			if v.Type == 2 {
+				v.IndustrialManagementId = activityIndustryMap[v.ActivityId]
+			}
+		}
+	}
 	respList = videoList
 	return
 }