Selaa lähdekoodia

Merge branch 'ETA_2.1.6' into debug

zwxi 7 kuukautta sitten
vanhempi
commit
3670929065
2 muutettua tiedostoa jossa 22 lisäystä ja 4 poistoa
  1. 20 3
      controllers/data_manage/chart_info.go
  2. 2 1
      models/data_manage/chart_info.go

+ 20 - 3
controllers/data_manage/chart_info.go

@@ -4555,6 +4555,7 @@ func (this *ChartInfoController) ChartList() {
 	currentIndex, _ := this.GetInt("CurrentIndex")
 	keyWord := this.GetString("KeyWord")
 	sysUserIds := this.GetString("SysUserIds")
+	chartTypeIds := this.GetString("ChartTypeIds")
 
 	var total int
 	page := paging.GetPaging(currentIndex, pageSize, total)
@@ -4618,6 +4619,11 @@ func (this *ChartInfoController) ChartList() {
 		condition += "  AND sys_user_id in (" + utils.GetOrmInReplace(len(adminIds)) + ") "
 		pars = append(pars, adminIdsSlice)
 	}
+	if chartTypeIds != "" {
+		chartTypeIdList := strings.Split(chartTypeIds, ",")
+		condition += "  AND chart_type in (" + utils.GetOrmInReplace(len(chartTypeIdList)) + ") "
+		pars = append(pars, chartTypeIdList)
+	}
 
 	//只看我的
 	//isShowMe, _ := this.GetBool("IsShowMe")
@@ -4803,7 +4809,8 @@ func (this *ChartInfoController) ModifyChartList() {
 		//根据查询条件筛选
 		chartClassifyIds := strings.Split(req.ChartClassifyIds, ",")
 		sysUserIds := req.SysUserIds
-		chartName := req.ChartName
+		keyword := req.KeyWord
+		chartTypeIdsStr := req.ChartTypeIds
 
 		condition := " AND source = ? "
 		pars := make([]interface{}, 0)
@@ -4850,9 +4857,19 @@ func (this *ChartInfoController) ModifyChartList() {
 			pars = append(pars, adminIdsSlice)
 		}
 
-		if chartName != "" {
+		if keyword != "" {
 			condition = " AND chart_name LIKE ? "
-			pars = append(pars, utils.GetLikeKeyword(chartName))
+			pars = append(pars, utils.GetLikeKeyword(keyword))
+		}
+
+		if chartTypeIdsStr != "" {
+			chartTypeIds := strings.Split(chartTypeIdsStr, ",")
+			if len(chartTypeIds) == 0 {
+				br.Msg = "请选择正确的图表类型"
+				return
+			}
+			condition += " AND chart_type IN(" + utils.GetOrmInReplace(len(chartTypeIds)) + ") "
+			pars = append(pars, chartTypeIds)
 		}
 
 		allChartInfo, err := data_manage.GetChartInfoItemsByCondition(condition, pars)

+ 2 - 1
models/data_manage/chart_info.go

@@ -2919,9 +2919,10 @@ type ModifyChartListReq struct {
 	SubClassify      bool `description:"是否关联图表子分类"`
 	ChartClassifyIds string
 	SysUserIds       string
-	ChartName        string
+	KeyWord        string
 	ChartInfoIds     string `description:"图表ID"`
 	ChartClassifyId  int    `description:"新图表分类"`
+	ChartTypeIds     string
 }