diff --git a/app/admin/hdl/hdl_comm.go b/app/admin/hdl/hdl_comm.go index ebe8e6c..e2d9626 100644 --- a/app/admin/hdl/hdl_comm.go +++ b/app/admin/hdl/hdl_comm.go @@ -14,7 +14,7 @@ func MenuList(c *gin.Context) { admin := svc.GetUser(c) qrcodeWithBatchRecordsDb := db.PermissionGroupDb{} qrcodeWithBatchRecordsDb.Set() - groupList, err := qrcodeWithBatchRecordsDb.FindPermissionGroup() + groupList, err := qrcodeWithBatchRecordsDb.FindPermissionGroupV2() if err != nil { e.OutErr(c, e.ERR_DB_ORM, err.Error()) return @@ -46,6 +46,7 @@ func MenuList(c *gin.Context) { var tempRespMap = map[string]*md.PermissionGroupListResp{} var tempRespMapKeys []string for _, v := range *groupList { + var isCheck bool if admin.IsSuperAdministrator == enum.IsSuperAdministratorTure { isCheck = true @@ -56,6 +57,11 @@ func MenuList(c *gin.Context) { if utils.InArr(utils.IntToStr(v.Id), adminHasPermissionGroupIds) { isCheck = true } + + if v.State == enum.PermissionGroupStateForNormal { + isCheck = false + } + tempRespMap[utils.IntToStr(v.Id)] = &md.PermissionGroupListResp{ Id: v.Id, Name: v.Name, diff --git a/app/admin/svc/svc_data_statisstics.go b/app/admin/svc/svc_data_statisstics.go index 82ea519..9609df0 100644 --- a/app/admin/svc/svc_data_statisstics.go +++ b/app/admin/svc/svc_data_statisstics.go @@ -224,7 +224,7 @@ func SelfSupportForSchoolDataStatisticsExport(req md.SelfSupportForSchoolDataSta switch req.Kind { case 1: //教师消费统计表 - xlsx, _ := excelize.OpenFile("./static/upload/自营学校(教师消费统计表).xlsx") + xlsx, _ := excelize.OpenFile("./static/template/自营学校(教师消费统计表).xlsx") fileName = "教师消费统计表_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" downloadPath = "/export/self_support_for_school/" + fileName @@ -301,7 +301,7 @@ func SelfSupportForSchoolDataStatisticsExport(req md.SelfSupportForSchoolDataSta break case 2: //商家分餐数据统计表 - xlsx, _ := excelize.OpenFile("./static/upload/自营学校(商家分餐数据统计表).xlsx") + xlsx, _ := excelize.OpenFile("./static/template/自营学校(商家分餐数据统计表).xlsx") fileName = "商家分餐数据统计表_" + utils.Int64ToStr(now.UnixMilli()) + ".xlsx" downloadPath = "/export/self_support_for_school/" + fileName diff --git a/app/db/db_permission_group.go b/app/db/db_permission_group.go index 05f7510..2d2659d 100644 --- a/app/db/db_permission_group.go +++ b/app/db/db_permission_group.go @@ -22,3 +22,11 @@ func (permissionGroupDb *PermissionGroupDb) FindPermissionGroup() (*[]model.Perm } return &m, nil } + +func (permissionGroupDb *PermissionGroupDb) FindPermissionGroupV2() (*[]model.PermissionGroup, error) { + var m []model.PermissionGroup + if err := permissionGroupDb.Db.Asc("id").Find(&m); err != nil { + return nil, logx.Error(err) + } + return &m, nil +}