|
@@ -290,8 +290,12 @@ func (this *UserController) ApplyTryOut() {
|
|
|
uid := user.UserId
|
|
|
|
|
|
var title string
|
|
|
+ var sourceId int
|
|
|
+ var source string
|
|
|
tryType := req.TryType
|
|
|
detailId := req.DetailId
|
|
|
+ sourceId = detailId
|
|
|
+ source = tryType
|
|
|
var isResearch bool // 是否属于研选
|
|
|
if tryType == "Article" {
|
|
|
detail, err := models.GetArticleDetailById(detailId)
|
|
@@ -301,7 +305,6 @@ func (this *UserController) ApplyTryOut() {
|
|
|
return
|
|
|
}
|
|
|
title = detail.Title
|
|
|
- title = detail.Title
|
|
|
if detail.ArticleTypeId > 0 {
|
|
|
isResearch = true
|
|
|
}
|
|
@@ -325,6 +328,19 @@ func (this *UserController) ApplyTryOut() {
|
|
|
return
|
|
|
}
|
|
|
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.Title
|
|
|
+ sourceId = activityVideo.ActivityId
|
|
|
+ source = "activityvideo"
|
|
|
} else if tryType == "MicroVideo" {
|
|
|
// 微路演视频
|
|
|
microVideo, e := models.GetMicroRoadshowVideoById(detailId)
|
|
@@ -334,6 +350,7 @@ func (this *UserController) ApplyTryOut() {
|
|
|
return
|
|
|
}
|
|
|
title = microVideo.VideoName
|
|
|
+ source = "roadshow"
|
|
|
} else if tryType == "Researchsummary" {
|
|
|
// 本周研究汇总
|
|
|
ResearchSummaryInfo, e := models.GetCygxResearchSummaryInfoById(detailId)
|
|
@@ -343,6 +360,7 @@ func (this *UserController) ApplyTryOut() {
|
|
|
return
|
|
|
}
|
|
|
title = ResearchSummaryInfo.Title
|
|
|
+ source = "researchsummary"
|
|
|
} else if tryType == "Minutessummary" {
|
|
|
// 上周纪要汇总
|
|
|
MinutesSummaryInfo, e := models.GetCygxMinutesSummaryInfoById(detailId)
|
|
@@ -352,6 +370,7 @@ func (this *UserController) ApplyTryOut() {
|
|
|
return
|
|
|
}
|
|
|
title = MinutesSummaryInfo.Title
|
|
|
+ source = "minutessummary"
|
|
|
} else if tryType == "ReportSelection" {
|
|
|
// 报告精选
|
|
|
ReportSelectionInfo, e := models.GetCygxReportSelectionInfoById(detailId)
|
|
@@ -361,6 +380,7 @@ func (this *UserController) ApplyTryOut() {
|
|
|
return
|
|
|
}
|
|
|
title = ReportSelectionInfo.Title
|
|
|
+ source = "reportselection"
|
|
|
} else if tryType == "ProductInterior" {
|
|
|
// 产品内测
|
|
|
ProductInteriorDetail, e := models.GetCygxProductInteriorDetail(detailId)
|
|
@@ -370,6 +390,7 @@ func (this *UserController) ApplyTryOut() {
|
|
|
return
|
|
|
}
|
|
|
title = ProductInteriorDetail.Title
|
|
|
+ source = "productinterior"
|
|
|
}
|
|
|
|
|
|
//缓存校验
|
|
@@ -579,6 +600,9 @@ func (this *UserController) ApplyTryOut() {
|
|
|
//如果是潜在客户就标记来源
|
|
|
item.InviteCompanySource = 2
|
|
|
}
|
|
|
+ item.Title = title
|
|
|
+ item.SourceId = sourceId
|
|
|
+ item.Source = strings.ToLower(source)
|
|
|
item.RegisterPlatform = utils.REGISTER_PLATFORM
|
|
|
err = models.AddApplyRecord(item)
|
|
|
|