Explorar el Código

Merge branch 'eta_bug_pci_report_1126@guomengyuan'

gmy hace 3 meses
padre
commit
cbc841b359
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      models/document_manage_model/outside_report.go

+ 4 - 4
models/document_manage_model/outside_report.go

@@ -59,11 +59,11 @@ func GetOutsideReportListByConditionCount(condition string, pars []interface{})
 	sql += condition
 
 	err = o.Raw(sql, pars).QueryRow(&count)
-	if err != nil {
+	if err != nil && err != orm.ErrNoRows {
 		return 0, err
 	}
 
-	return count, err
+	return count, nil
 }
 
 // GetOutsideReportListByCondition 根据条件查询列表
@@ -75,11 +75,11 @@ t1.modify_time, t1.create_time, t1.report_code 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).QueryRows(&list)
-	if err != nil {
+	if err != nil && err != orm.ErrNoRows {
 		return nil, err
 	}
 
-	return list, err
+	return list, nil
 }
 
 // SaveOutsideReport 保存报告