浏览代码

Merge branch 'cygx_8.7' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 2 年之前
父节点
当前提交
443037f6d7
共有 1 个文件被更改,包括 26 次插入15 次删除
  1. 26 15
      controllers/activity.go

+ 26 - 15
controllers/activity.go

@@ -3142,19 +3142,6 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 		list[k].Resource = 1
 	}
 
-	//查询专项产业调研展示权限 仅对大套餐客户跟永续客户展示
-	if whichDay == "" {
-		speciaItem, err := services.GetActivityLabelSpecialList(user, isPower, chartPermissionIds, permissionNameStr)
-		if err != nil {
-			br.Msg = "获取失败"
-			br.ErrMsg = "获取失败,Err:" + err.Error()
-			return
-		}
-		if len(speciaItem.List) > 0 {
-			list = append(list, speciaItem)
-		}
-	}
-
 	//获取对应活动的数量并排序
 	activityIds := make([]int, 0) // 用于查询活动【新】标签Map
 	intArr := make([]int, 0)
@@ -3209,6 +3196,7 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 			}
 		}
 	}
+	var lenList int
 	//按照像素进行排序
 	rowHeight := 83     //每一行的行高
 	basicsHeight := 178 // 基础高度
@@ -3221,10 +3209,33 @@ func (this *ActivityCoAntroller) LabelTypeListV5() {
 			position = 2
 		}
 		itemsNew[k].Position = position
+		lenList = len(v.List)
+		if lenList > 8 {
+			lenList = 8
+		}
 		if position == 1 {
-			leftPx += basicsHeight + rowHeight*len(v.List)
+			leftPx += basicsHeight + rowHeight*lenList
+		} else {
+			rightPx += basicsHeight + rowHeight*lenList
+		}
+	}
+
+	//查询专项产业调研展示权限 仅对大套餐客户跟永续客户展示
+	if whichDay == "" {
+
+		speciaItem, err := services.GetActivityLabelSpecialList(user, isPower, chartPermissionIds, permissionNameStr)
+		if err != nil {
+			br.Msg = "获取失败"
+			br.ErrMsg = "获取失败,Err:" + err.Error()
+			return
+		}
+		if leftPx > rightPx {
+			speciaItem.Position = 2
 		} else {
-			rightPx += basicsHeight + rowHeight*len(v.List)
+			speciaItem.Position = 1
+		}
+		if len(speciaItem.List) > 0 {
+			list = append(list, speciaItem)
 		}
 	}
 	//记录用户搜索的筛选条件