|
@@ -54,7 +54,7 @@ func init() {
|
|
|
|
|
|
// GetOutsideReportListByConditionCount 根据条件查询列表条数
|
|
|
func GetOutsideReportListByConditionCount(condition string, pars []interface{}) (count int, err error) {
|
|
|
- o := orm.NewOrmUsingDB("rddp")
|
|
|
+ o := orm.NewOrm()
|
|
|
sql := `select count(distinct t1.outside_report_id) from outside_report t1 left join chart_permission_search_key_word_mapping t2 on t1.classify_id = t2.classify_id where 1 = 1 `
|
|
|
sql += condition
|
|
|
err = o.Raw(sql, pars).QueryRow(&count)
|
|
@@ -67,10 +67,9 @@ func GetOutsideReportListByConditionCount(condition string, pars []interface{})
|
|
|
|
|
|
// GetOutsideReportByReportCode 根据Code获取报告
|
|
|
func GetOutsideReportByReportCode(reportCode string) (outsideReport *OutsideReport, err error) {
|
|
|
- o := orm.NewOrmUsingDB("rddp")
|
|
|
-
|
|
|
- outsideReport = &OutsideReport{}
|
|
|
-
|
|
|
- err = o.QueryTable("outside_report").Filter("report_code", reportCode).One(outsideReport)
|
|
|
- return
|
|
|
+ o := orm.NewOrm()
|
|
|
+
|
|
|
+ sql := `SELECT * FROM outside_report WHERE report_code=?`
|
|
|
+ err = o.Raw(sql, reportCode).QueryRow(&outsideReport)
|
|
|
+ return outsideReport, err
|
|
|
}
|