Roc 2 years ago
parent
commit
f1bc196fee
1 changed files with 16 additions and 0 deletions
  1. 16 0
      models/edb_info.go

+ 16 - 0
models/edb_info.go

@@ -251,3 +251,19 @@ func GetEdbDataListAllV1(condition string, pars []interface{}, source, order int
 	_, err = o.Raw(sql, pars).QueryRows(&item)
 	return
 }
+
+// GetEdbInfoByCondition 获取指标列表
+func GetEdbInfoByCondition(condition string, pars []interface{}, order int) (item []*EdbInfo, err error) {
+	o := orm.NewOrm()
+	sql := ` SELECT * FROM edb_info WHERE 1=1 `
+	if condition != "" {
+		sql += condition
+	}
+	if order == 1 {
+		sql += ` ORDER BY end_date ASC `
+	} else {
+		sql += ` ORDER BY edb_info_id ASC `
+	}
+	_, err = o.Raw(sql, pars).QueryRows(&item)
+	return
+}