Browse Source

no message

xingzai 2 years ago
parent
commit
968073203a
2 changed files with 17 additions and 6 deletions
  1. 16 6
      controllers/report.go
  2. 1 0
      models/report_mapping.go

+ 16 - 6
controllers/report.go

@@ -258,6 +258,7 @@ func (this *ReportController) IndustryList() {
 // @Description 产业下所关联的文章分类列表接口
 // @Description 产业下所关联的文章分类列表接口
 // @Param   IndustrialManagementId   query   int  true       "产业ID"
 // @Param   IndustrialManagementId   query   int  true       "产业ID"
 // @Param   ShowTimeLine   query   int  true       "是否展示时间线 0不展示,1展示"
 // @Param   ShowTimeLine   query   int  true       "是否展示时间线 0不展示,1展示"
+// @Param   IsSendWx   query   int  false       "是否是通过微信模版进来的 1是,其它否"
 // @Success 200 {object} models.IndustrialToArticleCategoryListRep
 // @Success 200 {object} models.IndustrialToArticleCategoryListRep
 // @router /toArticleCategoryList [get]
 // @router /toArticleCategoryList [get]
 func (this *ReportController) ArticleCategoryList() {
 func (this *ReportController) ArticleCategoryList() {
@@ -279,6 +280,7 @@ func (this *ReportController) ArticleCategoryList() {
 		return
 		return
 	}
 	}
 	showTimeLine, _ := this.GetInt("ShowTimeLine", 0)
 	showTimeLine, _ := this.GetInt("ShowTimeLine", 0)
+	isSendWx, _ := this.GetInt("IsSendWx")
 
 
 	detail, err := models.GetIndustrialManagementDetail(industrialManagementId)
 	detail, err := models.GetIndustrialManagementDetail(industrialManagementId)
 	if err != nil {
 	if err != nil {
@@ -422,7 +424,7 @@ func (this *ReportController) ArticleCategoryList() {
 		timeLineRed := false
 		timeLineRed := false
 		if count < 2 {
 		if count < 2 {
 			timeLineRed = true
 			timeLineRed = true
-		} else if count > 1 && recordItem.CreateTime.Before(utils.StrTimeToTime(morningMeetingTime)){
+		} else if count > 1 && recordItem.CreateTime.Before(utils.StrTimeToTime(morningMeetingTime)) {
 			timeLineRed = true
 			timeLineRed = true
 		}
 		}
 		if !timeLineItem.IsRed && timeLineRed && haveMorningMeeting {
 		if !timeLineItem.IsRed && timeLineRed && haveMorningMeeting {
@@ -440,7 +442,15 @@ func (this *ReportController) ArticleCategoryList() {
 	if videoSimple.Id > 0 {
 	if videoSimple.Id > 0 {
 		resp.IndustryVideo = videoSimple
 		resp.IndustryVideo = videoSimple
 	}
 	}
-
+	if isSendWx == 1 {
+		industryUserFollowMap, err := services.GetIndustryUserFollowMap(user)
+		if err != nil {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "GetActivitySignupResp,Err:" + err.Error()
+			return
+		}
+		resp.IsFollowButton = industryUserFollowMap[industrialManagementId]
+	}
 	br.Ret = 200
 	br.Ret = 200
 	br.Success = true
 	br.Success = true
 	br.Msg = "获取成功"
 	br.Msg = "获取成功"
@@ -689,7 +699,7 @@ func (this *ReportController) List() {
 			timeLineRed := false
 			timeLineRed := false
 			if count < 2 && v.SubCategoryName == "时间线" {
 			if count < 2 && v.SubCategoryName == "时间线" {
 				timeLineRed = true
 				timeLineRed = true
-			} else if count > 1 && recordItem.CreateTime.Before(utils.StrTimeToTime(v.PublishTime)){
+			} else if count > 1 && recordItem.CreateTime.Before(utils.StrTimeToTime(v.PublishTime)) {
 				timeLineRed = true
 				timeLineRed = true
 			}
 			}
 			if v.SubCategoryName == "时间线" && timeLineRed {
 			if v.SubCategoryName == "时间线" && timeLineRed {
@@ -3031,11 +3041,11 @@ func (this *ReportController) SearchReportAndResource() {
 		industrialIdMap := make(map[string]time.Time)
 		industrialIdMap := make(map[string]time.Time)
 		for _, v := range recrodList {
 		for _, v := range recrodList {
 			industrialManagementIdstr = strings.TrimLeft(v.Parameter, "PageSize=10&CurrentIndex=1&CategoryId=99999&IndustrialManagementId=")
 			industrialManagementIdstr = strings.TrimLeft(v.Parameter, "PageSize=10&CurrentIndex=1&CategoryId=99999&IndustrialManagementId=")
-			if createTime, ok := industrialIdMap[industrialManagementIdstr]; ok{
+			if createTime, ok := industrialIdMap[industrialManagementIdstr]; ok {
 				if createTime.Before(v.CreateTime) {
 				if createTime.Before(v.CreateTime) {
 					industrialIdMap[industrialManagementIdstr] = v.CreateTime
 					industrialIdMap[industrialManagementIdstr] = v.CreateTime
 				}
 				}
-			}else {
+			} else {
 				industrialIdMap[industrialManagementIdstr] = v.CreateTime
 				industrialIdMap[industrialManagementIdstr] = v.CreateTime
 			}
 			}
 		}
 		}
@@ -3051,7 +3061,7 @@ func (this *ReportController) SearchReportAndResource() {
 		timeLineRedMap := make(map[int]bool, 0)
 		timeLineRedMap := make(map[int]bool, 0)
 
 
 		for _, industrialId := range industrialIdArr {
 		for _, industrialId := range industrialIdArr {
-			if createTime, ok := industrialIdMap[strconv.Itoa(industrialId)]; ok{
+			if createTime, ok := industrialIdMap[strconv.Itoa(industrialId)]; ok {
 				if createTime.Before(morningMeetingTimeMap[industrialId]) {
 				if createTime.Before(morningMeetingTimeMap[industrialId]) {
 					timeLineRedMap[industrialId] = true
 					timeLineRedMap[industrialId] = true
 				}
 				}

+ 1 - 0
models/report_mapping.go

@@ -106,6 +106,7 @@ type IndustrialToArticleCategoryListRep struct {
 	LayoutTime             string `description:"布局时间"`
 	LayoutTime             string `description:"布局时间"`
 	IndustryName           string `description:"产业名称"`
 	IndustryName           string `description:"产业名称"`
 	IndustrialManagementId int    `description:"产业D"`
 	IndustrialManagementId int    `description:"产业D"`
+	IsFollowButton         bool   `description:"是否关注"`
 	IndustryVideo          *MicroVideoSimpleInfo
 	IndustryVideo          *MicroVideoSimpleInfo
 	List                   []*IndustrialToArticleCategoryRep
 	List                   []*IndustrialToArticleCategoryRep
 }
 }