|
@@ -5,6 +5,7 @@ import (
|
|
"gorm.io/gorm"
|
|
"gorm.io/gorm"
|
|
"hongze/hongze_yb/global"
|
|
"hongze/hongze_yb/global"
|
|
"hongze/hongze_yb/models/tables/chart_permission"
|
|
"hongze/hongze_yb/models/tables/chart_permission"
|
|
|
|
+ "hongze/hongze_yb/models/tables/company_product"
|
|
"hongze/hongze_yb/models/tables/research_report"
|
|
"hongze/hongze_yb/models/tables/research_report"
|
|
"hongze/hongze_yb/models/tables/teleconference"
|
|
"hongze/hongze_yb/models/tables/teleconference"
|
|
"hongze/hongze_yb/models/tables/teleconference_video"
|
|
"hongze/hongze_yb/models/tables/teleconference_video"
|
|
@@ -177,8 +178,18 @@ func CheckActivityPermission(userInfo user.UserInfo, activityId int) (ok bool, p
|
|
|
|
|
|
// GetUserAuthActivityIds 获取用户有权限参与的活动Ids
|
|
// GetUserAuthActivityIds 获取用户有权限参与的活动Ids
|
|
func GetUserAuthActivityIds(userInfo user.UserInfo) (acrivityIds []int, err error) {
|
|
func GetUserAuthActivityIds(userInfo user.UserInfo) (acrivityIds []int, err error) {
|
|
- // 获取用户有效权限
|
|
|
|
productId := 1
|
|
productId := 1
|
|
|
|
+ // 查询用户产品状态是否正常
|
|
|
|
+ companyProduct, err := company_product.GetByCompany2ProductId(userInfo.CompanyID, int64(productId))
|
|
|
|
+ if err != nil {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ statusMatch := "正式,试用,永续"
|
|
|
|
+ if !strings.Contains(statusMatch, companyProduct.Status) || companyProduct.IsSuspend == 1 {
|
|
|
|
+ acrivityIds = append(acrivityIds, 0)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 获取用户有效权限
|
|
validPermissionIdList, err := company.GetValidPermissionIdListByCompany2ProductId(userInfo.CompanyID, int64(productId))
|
|
validPermissionIdList, err := company.GetValidPermissionIdListByCompany2ProductId(userInfo.CompanyID, int64(productId))
|
|
if err != nil {
|
|
if err != nil {
|
|
return
|
|
return
|