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