Browse Source

Merge branch 'cygx_11.1' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 1 năm trước cách đây
mục cha
commit
4b96120012

+ 1 - 1
controllers/activity.go

@@ -3803,7 +3803,7 @@ func (this *ActivityCoAntroller) ActivityListSearch() {
 	if source == 1 {
 		condition += ` AND art.yidong_activity_id = '' `
 	}
-	condition += ` AND art.is_limit_people = 1 AND art.publish_status = 1 ` + conditionActivity
+	condition += ` AND art.publish_status = 1 ` + conditionActivity
 	list, total, err := services.GetActivitySpecialSearcheList(user, condition, startSize, pageSize, keyWord)
 	if err != nil {
 		br.Msg = "获取失败"

+ 3 - 2
controllers/home.go

@@ -838,13 +838,14 @@ func (this *HomeController) NewList() {
 		pageSize = 4
 	} else {
 		condition += ` AND source NOT IN ('activity','activityspecial','newchart') ` + conditionInit
-		conditionActivity, err := services.GetActivityonditionList(user, "", "", "", "1,2,3", "", 0, 0, "", 0, 1)
+		//conditionActivity, err := services.GetActivityonditionList(user, "", "", "", "1,2,3", "", 0, 0, "", 0, 1)
+		conditionActivity, err := services.ActivityConditioninitSql(user, "", 0)
 		if err != nil && err.Error() != utils.ErrNoRow() {
 			br.Msg = "获取失败"
 			br.ErrMsg = "获取活动权限数据失败,Err:" + err.Error()
 			return
 		}
-		conditionActivity += ` AND art.is_limit_people = 1 AND art.publish_status = 1 `
+		conditionActivity += ` AND art.publish_status = 1 `
 		var conditionOrder string
 		conditionOrder = ` ORDER BY art.activity_time DESC ,  art.active_state ASC   `
 		conditionActivity += conditionOrder

+ 16 - 1
controllers/user.go

@@ -909,6 +909,17 @@ func (this *UserController) ApplyTryOut() {
 		title = microAudio.VoiceName
 		sourceId = microAudio.ActivityId
 		source = "activityvoice"
+	} else if tryType == "ActivityVideo" {
+		// 活动视频
+		activityVideo, e := models.GetCygxActivityVideoById(detailId)
+		if e != nil {
+			br.Msg = "操作失败"
+			br.ErrMsg = "微路演音频信息有误, 不存在的VoiceId: " + strconv.Itoa(detailId)
+			return
+		}
+		title = activityVideo.VideoName
+		sourceId = activityVideo.ActivityId
+		source = "activityvideo"
 	} else if tryType == "MicroVideo" {
 		// 微路演视频
 		microVideo, e := models.GetMicroRoadshowVideoById(detailId)
@@ -918,6 +929,7 @@ func (this *UserController) ApplyTryOut() {
 			return
 		}
 		title = microVideo.VideoName
+		source = "roadshow"
 	} else if tryType == "Researchsummary" {
 		// 本周研究汇总
 		ResearchSummaryInfo, e := models.GetCygxResearchSummaryInfoById(detailId)
@@ -927,6 +939,7 @@ func (this *UserController) ApplyTryOut() {
 			return
 		}
 		title = ResearchSummaryInfo.Title
+		source = "researchsummary"
 	} else if tryType == "Minutessummary" {
 		// 上周纪要汇总
 		MinutesSummaryInfo, e := models.GetCygxMinutesSummaryInfoById(detailId)
@@ -936,6 +949,7 @@ func (this *UserController) ApplyTryOut() {
 			return
 		}
 		title = MinutesSummaryInfo.Title
+		source = "minutessummary"
 	} else if tryType == "ReportSelection" {
 		// 报告精选
 		ReportSelectionInfo, e := models.GetCygxReportSelectionInfoById(detailId)
@@ -945,6 +959,7 @@ func (this *UserController) ApplyTryOut() {
 			return
 		}
 		title = ReportSelectionInfo.Title
+		source = "reportselection"
 	} else if tryType == "ProductInterior" {
 		// 产品内测
 		ProductInteriorDetail, e := models.GetCygxProductInteriorDetail(detailId)
@@ -954,9 +969,9 @@ func (this *UserController) ApplyTryOut() {
 			return
 		}
 		title = ProductInteriorDetail.Title
+		source = "productinterior"
 	}
 
-	fmt.Println(title)
 	//缓存校验
 	cacheKey := fmt.Sprint("xygx:apply_record:add:", uid)
 	ttlTime := utils.Rc.GetRedisTTL(cacheKey)

+ 2 - 2
models/activity_video.go

@@ -84,9 +84,9 @@ func GetCygxActivityVideoReqByActivityId(activityId int) (item *CygxActivityVide
 }
 
 // GetCygxActivityVideoById 获取活动视频
-func GetCygxActivityVideoById(activityId int) (item *CygxActivityVideo, err error) {
+func GetCygxActivityVideoById(videoId int) (item *CygxActivityVideo, err error) {
 	sql := `SELECT * FROM cygx_activity_video WHERE video_id = ? LIMIT 1 `
-	err = orm.NewOrm().Raw(sql, activityId).QueryRow(&item)
+	err = orm.NewOrm().Raw(sql, videoId).QueryRow(&item)
 	return
 }
 

+ 2 - 1
services/resource_data.go

@@ -218,8 +218,9 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 		var activityListRersp []*models.ActivityDetail
 		for _, v := range activityList {
 			v.SignupType = mapActivitySignup[v.ActivityId]
-			activityListRersp = append(activityListRersp, ActivityButtonShow(v))
+			//activityListRersp = append(activityListRersp, ActivityButtonShow(v))
 		}
+		activityListRersp = ActivityArrButtonShow(activityList)
 		for _, v := range activityListRersp {
 			if v == nil {
 				continue