Ver código fonte

Merge branch 'feature/eta1.2.2_edb_source' into debug

xyxie 1 ano atrás
pai
commit
568db580c0
1 arquivos alterados com 11 adições e 8 exclusões
  1. 11 8
      controllers/data_stat/edb_source_stat.go

+ 11 - 8
controllers/data_stat/edb_source_stat.go

@@ -462,7 +462,7 @@ func (this *EdbSourceStatController) EdbUpdateStat() {
 	sortParamReq := this.GetString("SortParam", "")
 	sortType := this.GetString("SortType", "desc")
 	terminalCode := this.GetString("TerminalCode", "")
-	sysUserId, _ := this.GetInt("SysUserId")
+	sysUserId := this.GetString("SysUserId", "")
 	frequency := this.GetString("Frequency", "")
 	keyWord := this.GetString("KeyWord", "") //指标编码/指标名称
 
@@ -496,18 +496,21 @@ func (this *EdbSourceStatController) EdbUpdateStat() {
 	}
 
 	if terminalCode != "" {
-		condition += " AND terminal_code = ?"
-		pars = append(pars, terminalCode)
+		codeSlice := strings.Split(terminalCode, ",")
+		condition += ` AND terminal_code IN (` + utils.GetOrmInReplace(len(codeSlice)) + `)`
+		pars = append(pars, codeSlice)
 	}
 
-	if sysUserId > 0 {
-		condition += " AND sys_user_id = ?"
-		pars = append(pars, sysUserId)
+	if sysUserId != "" {
+		sysUserIdSlice := strings.Split(sysUserId, ",")
+		condition += ` AND sys_user_id IN (` + utils.GetOrmInReplace(len(sysUserIdSlice)) + `)`
+		pars = append(pars, sysUserIdSlice)
 	}
 
 	if frequency != "" {
-		condition += " AND frequency = ?"
-		pars = append(pars, frequency)
+		frequencySlice := strings.Split(frequency, ",")
+		condition += ` AND frequency IN (` + utils.GetOrmInReplace(len(frequencySlice)) + `)`
+		pars = append(pars, frequencySlice)
 	}
 
 	if keyWord != "" {