123456789101112131415161718192021222324252627 |
- package company
- import (
- "hongze/hongze_yb/models/tables/company_report_permission"
- )
- // GetValidPermissionByCompany2ProductId 根据客户id和产品id获取有效的权限列表
- func GetValidPermissionByCompany2ProductId(companyId, productId int) (list []*company_report_permission.CompanyReportPermission, err error) {
- where := make(map[string]interface{})
- where["company_id ="] = companyId
- where["product_id ="] = productId
- where["status in"] = []string{"正式", "试用", "永续"}
- list, err = company_report_permission.GetByWhereMap(where)
- return
- }
- // GetValidPermissionIdListByCompany2ProductId 根据客户id和产品id获取有效的权限id列表
- func GetValidPermissionIdListByCompany2ProductId(companyId, productId int) (list []int, err error) {
- companyReportPermissionList, err := GetValidPermissionByCompany2ProductId(companyId, productId)
- if err != nil {
- return
- }
- for _, v := range companyReportPermissionList {
- list = append(list, v.ChartPermissionID)
- }
- return
- }
|