|
@@ -891,16 +891,10 @@ func GetSpecialUserType(user *models.WxUserItem) (userType int, err error) {
|
|
|
|
|
|
// GetSpecialDetailUserPower 处理用户查看专项调研详情的权限
|
|
|
func GetSpecialDetailUserPower(user *models.WxUserItem, activityInfo *models.CygxActivitySpecialDetail) (havePower bool, err error) {
|
|
|
- permissionStr, e := GetCompanyPermissionUpgrade(user.CompanyId)
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetCompanyPermissionUpgrade, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- //如果没有对应的升级权限,则返回
|
|
|
- if !strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
|
|
|
+ if user.CompanyId == utils.HZ_COMPANY_ID {
|
|
|
+ havePower = true
|
|
|
return
|
|
|
}
|
|
|
- //userType, e := GetSpecialUserType(user)
|
|
|
userType, _, e := GetUserType(user.CompanyId)
|
|
|
if e != nil {
|
|
|
err = errors.New("GetSpecialUserType, Err: " + e.Error())
|
|
@@ -909,6 +903,31 @@ func GetSpecialDetailUserPower(user *models.WxUserItem, activityInfo *models.Cyg
|
|
|
if userType == 0 {
|
|
|
return
|
|
|
}
|
|
|
+ mapUserType, e := GetActivityCcustomerTypeList()
|
|
|
+ if e != nil {
|
|
|
+ err = e
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var userTypeStr string
|
|
|
+ // 永续客户、大套餐客户可以查看行业升级套餐客户 权限
|
|
|
+ if userTypeStr == "1" || userTypeStr == "2" {
|
|
|
+ if strings.Contains(activityInfo.CustomerTypeIds, userTypeStr) || strings.Contains(activityInfo.CustomerTypeIds, "8") {
|
|
|
+ havePower = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ userTypeStr = mapUserType[userType]
|
|
|
+ permissionStr, e := GetCompanyPermissionUpgrade(user.CompanyId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetCompanyPermissionUpgrade, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //如果没有对应的升级权限,则返回
|
|
|
+ if !strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //userType, e := GetSpecialUserType(user)
|
|
|
+
|
|
|
var pars []interface{}
|
|
|
var condition string
|
|
|
var userTypes string
|