ソースを参照

pci研报-未分类

gmy 3 ヶ月 前
コミット
661acb4fa9

+ 4 - 5
services/document_manage_service/document_manage_service.go

@@ -135,9 +135,7 @@ func DocumentReportList(documentType int, chartPermissionIdList []string, classi
 				return nil, err
 			}
 
-			if id == 0 {
-				classifyIdList = append(classifyIdList, classifyId)
-			} else {
+			if id > 0 {
 				childrenClassifyIdList, err := GetAllClassifyIdsByParentId(id)
 				if err != nil {
 					return nil, err
@@ -160,8 +158,9 @@ func DocumentReportList(documentType int, chartPermissionIdList []string, classi
 		condition += ` and (t1.title like ? or t1.sys_user_name like ?) `
 		pars = append(pars, "%"+keyword+"%", "%"+keyword+"%")
 	}
-
-	condition += `GROUP BY t1.outside_report_id HAVING COUNT(DISTINCT t2.chart_permission_id) = ` + strconv.Itoa(len(chartPermissionIdList))
+	if len(chartPermissionIdList) > 0 {
+		condition += ` GROUP BY t1.outside_report_id HAVING COUNT(DISTINCT t2.chart_permission_id) = ` + strconv.Itoa(len(chartPermissionIdList))
+	}
 
 	count, err := document_manage_model.GetOutsideReportListByConditionCount(condition, pars)
 	if err != nil {