|
@@ -7,10 +7,11 @@ import (
|
|
|
"eta_gn/eta_api/services"
|
|
|
"eta_gn/eta_api/utils"
|
|
|
"fmt"
|
|
|
- "github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
+
|
|
|
+ "github.com/rdlucklib/rdluck_tools/paging"
|
|
|
)
|
|
|
|
|
|
// ReportClassify
|
|
@@ -98,8 +99,18 @@ func (this *PptV2Controller) ReportClassify() {
|
|
|
classifyPpt[v.ClassifyId] = append(classifyPpt[v.ClassifyId], t)
|
|
|
}
|
|
|
|
|
|
- resp := make([]*models.PptReportClassifyItem, 0)
|
|
|
+ visibleUsers, err := models.GetClassifyVisibleAll()
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = fmt.Sprintf("获取可见用户失败, err: %s", err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ visibleUsersMap := make(map[int][]int)
|
|
|
+ for _, v := range visibleUsers {
|
|
|
+ visibleUsersMap[v.ClassifyId] = append(visibleUsersMap[v.ClassifyId], v.AdminId)
|
|
|
+ }
|
|
|
|
|
|
+ var resp []*models.PptReportClassifyItem
|
|
|
// 获取分类
|
|
|
classifies := make([]*models.Classify, 0)
|
|
|
{
|
|
@@ -145,6 +156,11 @@ func (this *PptV2Controller) ReportClassify() {
|
|
|
if !utils.InArrayByInt(classifyIds, v.Id) {
|
|
|
continue
|
|
|
}
|
|
|
+ if visible, ok := visibleUsersMap[v.Id]; ok {
|
|
|
+ if !utils.InArrayByInt(visible, sysUser.AdminId) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ }
|
|
|
classifies = append(classifies, v)
|
|
|
}
|
|
|
}
|