|
@@ -858,14 +858,22 @@ func GetActivityDetailUserPower(user *models.WxUserItem, activityInfo *models.Ac
|
|
|
}
|
|
|
|
|
|
if activityInfo.ActivityTypeId == 2 || activityInfo.ActivityTypeId == 6 || activityInfo.ActivityTypeId == 7 {
|
|
|
- if strings.Contains(permissionStr, activityInfo.ChartPermissionName+"(主观)") && strings.Contains(activityInfo.CustomerTypeIds, userTypeStr) {
|
|
|
+ if strings.Contains(permissionStr, activityInfo.ChartPermissionName+"(主观)") {
|
|
|
havePower = true
|
|
|
+ } else {
|
|
|
+ havePower = false
|
|
|
}
|
|
|
} else {
|
|
|
- if strings.Contains(permissionStr, activityInfo.ChartPermissionName+"(客观)") && strings.Contains(activityInfo.CustomerTypeIds, userTypeStr) {
|
|
|
+ if strings.Contains(permissionStr, activityInfo.ChartPermissionName+"(客观)") {
|
|
|
havePower = true
|
|
|
+ } else {
|
|
|
+ havePower = false
|
|
|
}
|
|
|
}
|
|
|
+ //如果主客观校验不通过,那么直接返回
|
|
|
+ if !havePower {
|
|
|
+ return
|
|
|
+ }
|
|
|
if (strings.Contains(activityInfo.ChartPermissionName, "研选") || activityInfo.ChartPermissionName == "策略") && strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
|
|
|
havePower = true
|
|
|
}
|
|
@@ -879,14 +887,23 @@ func GetActivityDetailUserPower(user *models.WxUserItem, activityInfo *models.Ac
|
|
|
err = errs
|
|
|
return
|
|
|
}
|
|
|
- if strings.Contains(permissionShengji, activityInfo.ChartPermissionName) && strings.Contains(activityInfo.CustomerTypeIds, "8") {
|
|
|
- havePower = true
|
|
|
- }
|
|
|
- fmt.Println("主客观2", havePower)
|
|
|
+ //if strings.Contains(permissionShengji, activityInfo.ChartPermissionName) && strings.Contains(activityInfo.CustomerTypeIds, "8") {
|
|
|
+ // havePower = true
|
|
|
+ //}
|
|
|
+ //fmt.Println("主客观2", havePower)
|
|
|
//if strings.Contains(permissionStr, activityInfo.ChartPermissionName) && strings.Contains(activityInfo.CustomerTypeIds, userTypeStr) {
|
|
|
// havePower = true
|
|
|
//}
|
|
|
- fmt.Println("主客观3", havePower)
|
|
|
+ //fmt.Println("主客观3", havePower)
|
|
|
+ //处理升级权限以及用户身份的 双重判断
|
|
|
+ if activityInfo.CustomerTypeIds != "" {
|
|
|
+ if !strings.Contains(activityInfo.CustomerTypeIds, userTypeStr) && userTypeStr != "8" {
|
|
|
+ havePower = false
|
|
|
+ if strings.Contains(permissionShengji, activityInfo.ChartPermissionName) && strings.Contains(activityInfo.CustomerTypeIds, "8") {
|
|
|
+ havePower = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if havePower && activityInfo.LimitPeopleNum > 0 {
|
|
|
//对于一些特殊的活动,即使权限满足也不给产看
|
|
|
noPower, e := GetShareNoPowe(activityInfo, permissionStr, userType, user)
|