|
@@ -474,14 +474,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
|
|
|
}
|
|
@@ -495,16 +503,20 @@ 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)
|
|
|
+
|
|
|
+ //fmt.Println("主客观2", havePower)
|
|
|
//if strings.Contains(permissionStr, activityInfo.ChartPermissionName) && strings.Contains(activityInfo.CustomerTypeIds, userTypeStr) {
|
|
|
// havePower = true
|
|
|
//}
|
|
|
- fmt.Println("主客观3", havePower)
|
|
|
- if !strings.Contains(activityInfo.CustomerTypeIds, userTypeStr) && userTypeStr != "8" {
|
|
|
- havePower = false
|
|
|
+ //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 {
|
|
|
//对于一些特殊的活动,即使权限满足也不给产看
|
|
@@ -543,6 +555,7 @@ func GetShareNoPowe(activityInfo *models.ActivityDetail, permissionStr string, u
|
|
|
//if userType == 3 && !strings.Contains(permissionStr, "专家") && !strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(3)) {
|
|
|
// noPower = true
|
|
|
//}
|
|
|
+ fmt.Println(userType)
|
|
|
if userType == 8 {
|
|
|
permissionShengji, errs := models.GetCompanyPermissionByUserZhengShiTrip(user.CompanyId)
|
|
|
if errs != nil {
|