Browse Source

New标签展示与,报告精选只展示一条

xingzai 2 years ago
parent
commit
39a97b2698
2 changed files with 11 additions and 6 deletions
  1. 7 5
      controllers/activity.go
  2. 4 1
      controllers/report.go

+ 7 - 5
controllers/activity.go

@@ -2785,7 +2785,7 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 	activityTypeId := this.GetString("ActivityTypeId")
 	keyWord := this.GetString("KeyWord")
 	playBack, _ := this.GetInt("PlayBack")
-	activityId, _ := this.GetInt("ActivityId")	// 仅用于判断【新】标签
+	activityId, _ := this.GetInt("ActivityId") // 仅用于判断【新】标签
 
 	if label == "undefined" {
 		label = ""
@@ -3618,7 +3618,7 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 	}
 
 	//获取对应活动的数量并排序
-	activityIds := make([]int, 0)	// 用于查询活动【新】标签Map
+	activityIds := make([]int, 0) // 用于查询活动【新】标签Map
 	intArr := make([]int, 0)
 	var items []*models.ActivityTypeHome
 	for _, v := range list {
@@ -3646,9 +3646,11 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 		br.ErrMsg = "获取活动【新】标签Map失败, Err: " + e.Error()
 		return
 	}
-	for k := range list {
-		for k2 := range list[k].List {
-			list[k].List[k2].IsNew = newLabelMap[list[k].List[k2].ActivityId]
+	for k, v := range list {
+		if v.ActivityTypeId == 1 {
+			for k2 := range list[k].List {
+				list[k].List[k2].IsNew = newLabelMap[list[k].List[k2].ActivityId]
+			}
 		}
 	}
 

+ 4 - 1
controllers/report.go

@@ -1285,7 +1285,10 @@ func (this *ReportController) ReportListByType() {
 		return
 	}
 	fmt.Println(tbdb)
-	condition = ` AND publish_status = 1`
+	condition = ` AND publish_status = 1  `
+	if reportType == "1" {
+		condition += ` LIMIT 1 `
+	}
 	total, err := models.GetCygxReportSelectionPublic(condition, tbdb, pars)
 	if err != nil {
 		br.Msg = "获取信息失败"