Browse Source

fix: 主题活动NEW标签

hsun 2 years ago
parent
commit
257606e731
1 changed files with 15 additions and 9 deletions
  1. 15 9
      controllers/activity.go

+ 15 - 9
controllers/activity.go

@@ -2758,6 +2758,7 @@ func (this *ActivityCoAntroller) LabelMoreList() {
 // @Param   IsPower   query   int  false       "是否选择有权限行业 ,1是 0 否 默认0"
 // @Param   PlayBack   query   int  false       "是否仅展示回放 1:是、0:否 默认0"
 // @Param   KeyWord   query   string  false       "搜索关键词 多个用 , 隔开"
+// @Param   ActivityId   query   int  false       "活动列表传过来的活动ID"
 // @Success 200 {object} models.GetCygxActivityListRep
 // @router /listNew [get]
 func (this *ActivityCoAntroller) ActivityListNew() {
@@ -2783,6 +2784,8 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 	activityTypeId := this.GetString("ActivityTypeId")
 	keyWord := this.GetString("KeyWord")
 	playBack, _ := this.GetInt("PlayBack")
+	activityId, _ := this.GetInt("ActivityId")	// 仅用于判断【新】标签
+
 	if label == "undefined" {
 		label = ""
 	}
@@ -3005,15 +3008,6 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 			return
 		}
 		if industry != nil {
-			// 产业新标签
-			industryIds := []int{industry.IndustrialManagementId}
-			industryNewMap, e := services.GetIndustryNewLabelMap(industryIds)
-			if e != nil {
-				br.Msg = "获取信息失败"
-				br.ErrMsg = "获取产业新标签失败, Err: " + e.Error()
-				return
-			}
-			resp.IndustryNewLabel = industryNewMap[industry.IndustrialManagementId]
 			sourceIndustry, e := models.GetSourceIndustryByName(label)
 			if e != nil && e.Error() != utils.ErrNoRow() {
 				br.Msg = "获取信息失败"
@@ -3029,6 +3023,18 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 				}
 			}
 		}
+		// 新标签
+		if activityId > 0 {
+			// 产业新标签
+			activityIds := []int{activityId}
+			activityNewMap, _, e := services.GetActivityNewLabelMap(activityIds)
+			if e != nil {
+				br.Msg = "获取信息失败"
+				br.ErrMsg = "获取活动新标签失败, Err: " + e.Error()
+				return
+			}
+			resp.IndustryNewLabel = activityNewMap[activityId]
+		}
 	}
 
 	//添加活动搜索记录