|
@@ -6,6 +6,7 @@ import (
|
|
|
"hongze/hz_crm_api/models"
|
|
|
"hongze/hz_crm_api/models/cygx"
|
|
|
"hongze/hz_crm_api/models/roadshow"
|
|
|
+ cygxService "hongze/hz_crm_api/services/cygx"
|
|
|
"hongze/hz_crm_api/utils"
|
|
|
"strconv"
|
|
|
"time"
|
|
@@ -160,10 +161,13 @@ func (this *UserRaiLabelController) Detail() {
|
|
|
br.ErrMsg = "操作失败,Err:" + errInfo.Error()
|
|
|
return
|
|
|
}
|
|
|
+ activitySignupDetai, _ := cygx.GetCygxActivitySignupDetailDetailLast(sourceId, detail.UserId)
|
|
|
item.ActivityName = activityInfo.ActivityName
|
|
|
item.ActivityTypeName = activityInfo.ActivityTypeName
|
|
|
item.ActivityTime = activityInfo.ActivityTime
|
|
|
- item.Duration = "5'30''"
|
|
|
+ if activitySignupDetai != nil {
|
|
|
+ item.Duration = activitySignupDetai.Duration
|
|
|
+ }
|
|
|
item.Label = detail.Label
|
|
|
resp.Activity = item
|
|
|
case 3, 5:
|
|
@@ -199,18 +203,69 @@ func (this *UserRaiLabelController) Detail() {
|
|
|
item.CreateTime = detail.CreateTime.Format(utils.FormatDateTime)
|
|
|
resp.Seller = item
|
|
|
case 7, 8:
|
|
|
- detailArticle, err := cygx.GetArticleIdInfoByArticleId(sourceId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "内容不存在"
|
|
|
- br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
item := new(cygx.WxUserRaiLabelArticleResp)
|
|
|
- item.Title = detailArticle.Title
|
|
|
- item.PublishDate = detailArticle.PublishDate
|
|
|
- item.CreateTime = detail.CreateTime.Format(utils.FormatDateTime)
|
|
|
- item.SourceText = "查研观向小程序"
|
|
|
- item.StopTime = "2:30"
|
|
|
+ switch detail.TableName {
|
|
|
+ case "cygx_article":
|
|
|
+ //文章
|
|
|
+ detailArticle, err := cygx.GetArticleIdInfoByArticleId(sourceId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "内容不存在"
|
|
|
+ br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ historyDetail, err := cygx.GetCygxArticleHistoryRecordAllDetailLast(sourceId, detail.UserId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "内容不存在"
|
|
|
+ br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ item.Title = detailArticle.Title
|
|
|
+ item.PublishDate = detailArticle.PublishDate.Format(utils.FormatDateTime)
|
|
|
+ item.CreateTime = detail.CreateTime.Format(utils.FormatDateTime)
|
|
|
+ item.SourceText = cygxService.GetArticleSourcePlatformText(historyDetail.RegisterPlatform)
|
|
|
+ item.StopTime = strconv.Itoa(historyDetail.StopTime)
|
|
|
+
|
|
|
+ case "cygx_report_selection":
|
|
|
+ //报告精选
|
|
|
+ detailReportSelection, err := cygx.GetCygxReportSelectionInfoById(sourceId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "内容不存在"
|
|
|
+ br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ historyDetail, err := cygx.GetCygxReportHistoryRecordDetailLast(sourceId, detail.UserId, "bgjx")
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "内容不存在"
|
|
|
+ br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ item.Title = detailReportSelection.Title
|
|
|
+ item.PublishDate = detailReportSelection.PublishDate
|
|
|
+ item.CreateTime = detail.CreateTime.Format(utils.FormatDateTime)
|
|
|
+ item.SourceText = cygxService.GetArticleSourcePlatformText(historyDetail.RegisterPlatform)
|
|
|
+ item.StopTime = strconv.Itoa(historyDetail.StopTime)
|
|
|
+
|
|
|
+ case "cygx_research_summary":
|
|
|
+ //本周研究汇总
|
|
|
+ detailResearchSummary, err := cygx.GetCygxResearchSummaryInfoById(sourceId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "内容不存在"
|
|
|
+ br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ historyDetail, err := cygx.GetCygxReportHistoryRecordDetailLast(sourceId, detail.UserId, "bzyjhz")
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "内容不存在"
|
|
|
+ br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ item.Title = detailResearchSummary.Title
|
|
|
+ item.PublishDate = detailResearchSummary.PublishDate
|
|
|
+ item.CreateTime = detail.CreateTime.Format(utils.FormatDateTime)
|
|
|
+ item.SourceText = cygxService.GetArticleSourcePlatformText(historyDetail.RegisterPlatform)
|
|
|
+ item.StopTime = strconv.Itoa(historyDetail.StopTime)
|
|
|
+ }
|
|
|
+
|
|
|
item.Label = detail.Label
|
|
|
resp.Article = item
|
|
|
}
|