浏览代码

Merge branch 'cygx_13.5' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 10 月之前
父节点
当前提交
0d84b89921
共有 2 个文件被更改,包括 24 次插入1 次删除
  1. 16 0
      controllers/chart_permission.go
  2. 8 1
      models/report_mapping.go

+ 16 - 0
controllers/chart_permission.go

@@ -222,12 +222,28 @@ func (this *ChartPermissionAuthController) StrategyDetail() {
 			item.CategoryId = utils.TIME_LINE_ID
 			item.SubCategoryName = utils.TIME_LINE_NAME
 			item.MatchTypeName = utils.TIME_LINE_NAME
+			item.ListGroup = 1
 			resp.List = append(resp.List, item)
 		}
 	}
 	for _, v := range list {
 		resp.List = append(resp.List, v)
 	}
+
+	if chartPermissionId == utils.CE_LUE_ID {
+		for _, v := range resp.List {
+			switch v.ListGroup {
+			case 1:
+				resp.ListGroup1 = append(resp.ListGroup1, v)
+			case 2:
+				resp.ListGroup2 = append(resp.ListGroup2, v)
+			case 3:
+				resp.ListGroup3 = append(resp.ListGroup3, v)
+			case 4:
+				resp.ListGroup4 = append(resp.ListGroup4, v)
+			}
+		}
+	}
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"

+ 8 - 1
models/report_mapping.go

@@ -42,6 +42,7 @@ type ReportMappingHome struct {
 	SubCategoryName string `description:"主题名称"`
 	MatchTypeName   string `description:"匹配类型"`
 	IsRed           bool   `description:"是否标红"`
+	ListGroup       int    `description:"第几组"`
 }
 
 type TradeReportMapping struct {
@@ -60,7 +61,11 @@ type ReportMappingResp struct {
 }
 
 type ReportMappingHomeResp struct {
-	List []*ReportMappingHome
+	List       []*ReportMappingHome
+	ListGroup1 []*ReportMappingHome
+	ListGroup2 []*ReportMappingHome
+	ListGroup3 []*ReportMappingHome
+	ListGroup4 []*ReportMappingHome
 }
 
 type TradeReportMappingResp struct {
@@ -99,6 +104,7 @@ func GetReportMappingStrategyHomeAllByCygx(chartPermissionId int) (items []*Repo
 	o := orm.NewOrm()
 	sql := `SELECT
 	re.id AS category_id,
+	re.list_group,
 	re.match_type_name 
 FROM
 	cygx_report_mapping_cygx AS re
@@ -108,6 +114,7 @@ WHERE
 	1 = 1 
 	AND re.chart_permission_id = ? 
 	AND re.report_type = 1 
+	AND re.list_group > 0 
 GROUP BY
 	re.match_type_name 
 ORDER BY