Ver Fonte

pci报告

gmy há 3 meses atrás
pai
commit
4a08fb2554
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      models/document_manage_model/outside_report.go

+ 3 - 1
models/document_manage_model/outside_report.go

@@ -52,11 +52,13 @@ func init() {
 // GetOutsideReportListByConditionCount 根据条件查询列表条数
 func GetOutsideReportListByConditionCount(condition string, pars []interface{}) (count int, err error) {
 	o := orm.NewOrmUsingDB("rddp")
-	sql := `SELECT COUNT( DISTINCT t1.outside_report_id ) 
+	sql := `select count(1) from ( 
+			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
+	sql += ` ) t`
 
 	err = o.Raw(sql, pars).QueryRow(&count)
 	if err != nil && err != orm.ErrNoRows {