Browse Source

活动关联报告链接展示

xingzai 2 years ago
parent
commit
a27790c17d
2 changed files with 23 additions and 0 deletions
  1. 17 0
      controllers/activity.go
  2. 6 0
      models/activity.go

+ 17 - 0
controllers/activity.go

@@ -824,6 +824,23 @@ func (this *ActivityCoAntroller) Detail() {
 		if activityInfo.IsHideAppointment == 0 {
 			activityInfo.IsShowAppointment = services.IsShowAppointment(activityInfo.ActivityTypeId, activityInfo.ChartPermissionName)
 		}
+		if activityInfo.ReportLink != "" {
+			artList := strings.Split(activityInfo.ReportLink, "{|}")
+			if len(artList) > 0 {
+				for _, v := range artList {
+					artitem := new(models.ActivityArticleResp)
+					artitem.ReportLink = v
+					artIdSlice := strings.Split(v, "/")
+					if len(artIdSlice) > 0 {
+						articleId, _ := strconv.Atoi(artIdSlice[len(artIdSlice)-1])
+						artitem.ArticleId = articleId
+					}
+					activityInfo.ArticleList = append(activityInfo.ArticleList, artitem)
+				}
+			}
+		} else {
+			activityInfo.ArticleList = make([]*models.ActivityArticleResp, 0)
+		}
 		resp.Detail = activityInfo
 	}
 	resp.HasPermission = hasPermission

+ 6 - 0
models/activity.go

@@ -51,6 +51,11 @@ type ActivityRep struct {
 	DoType            int    `description:"操作类型 0,保存 、1,发布"`
 }
 
+type ActivityArticleResp struct {
+	ReportLink string `description:"报告链接"`
+	ArticleId  int    `description:"报告id(报告链接跳转使用)"`
+}
+
 //活动详情
 type ActivityDetail struct {
 	ActivityId              int    `orm:"column(activity_id);pk";description:"活动ID "`
@@ -101,6 +106,7 @@ type ActivityDetail struct {
 	Scale                   string `description:"管理规模,空不填,1::50亿以下,2:50~100亿,3:100亿以上。多个用, 隔开"`
 	IsShowAppointment       bool   `description:"是否展示预约纪要"`
 	IsHideAppointment       int    `description:"是否隐藏预约纪要按钮  1是,0 否"`
+	ArticleList             []*ActivityArticleResp
 }
 
 type CygxActivityResp struct {