Kaynağa Gözat

Merge branch 'eta/1.1.6' into debug

Roc 1 yıl önce
ebeveyn
işleme
3e1dc960cd
1 değiştirilmiş dosya ile 19 ekleme ve 8 silme
  1. 19 8
      controllers/data_manage/edb_info.go

+ 19 - 8
controllers/data_manage/edb_info.go

@@ -4098,6 +4098,18 @@ func (this *EdbInfoController) AllEdbInfoByEs() {
 
 		// 普通的搜索
 		total, edbInfoList, err = elastic.SearchEdbInfoData(utils.DATA_INDEX_NAME, keyWord, startSize, pageSize, filterSource, source, -1, ``, noPermissionEdbInfoIdList)
+	} else {
+		var condition string
+		var pars []interface{}
+
+		// 无权限指标id
+		lenNoPermissionEdbInfoIdList := len(noPermissionEdbInfoIdList)
+		if lenNoPermissionEdbInfoIdList > 0 {
+			condition += ` AND edb_info_id  not in (` + utils.GetOrmInReplace(lenNoPermissionEdbInfoIdList) + `) `
+			pars = append(pars, noPermissionEdbInfoIdList)
+		}
+
+		total, edbInfoList, err = data_manage.GetEdbInfoFilterList(condition, pars, startSize, pageSize)
 	}
 	if err != nil {
 		edbInfoList = make([]*data_manage.EdbInfoList, 0)
@@ -4264,6 +4276,10 @@ func (this *EdbInfoController) GetEdbBeforeAndAfterDateData() {
 		dateType = "month"
 	}
 
+	resp := data_manage.BeforeAndAfterDateDataResp{
+		List: dataList,
+		Date: "",
+	}
 	// 后面的数据
 	afterList := make([]*data_manage.EdbDataList, 0)
 	if isFindAfter {
@@ -4279,7 +4295,7 @@ func (this *EdbInfoController) GetEdbBeforeAndAfterDateData() {
 			br.Ret = 200
 			br.Success = true
 			br.Msg = "所选指标所选日期无值"
-			br.Data = dataList
+			br.Data = resp
 			return
 		} else {
 			var dateTimeStr string
@@ -4325,14 +4341,9 @@ func (this *EdbInfoController) GetEdbBeforeAndAfterDateData() {
 		dataList[i], dataList[j] = dataList[j], dataList[i]
 	}
 
-	resp := data_manage.BeforeAndAfterDateDataResp{
-		List: dataList,
-		Date: currDate,
-	}
-
 	// 前端不传入日期的时候,这个J皮不让返回这个字段,要不然他会颜色标记
-	if date == `` {
-		resp.Date = ``
+	if date != `` {
+		resp.Date = currDate
 	}
 
 	br.Ret = 200