|
@@ -99,16 +99,7 @@ func (this *ActivityCoAntroller) ActivityList() {
|
|
|
br.ErrMsg = "操作失败,Err:" + errSearch.Error()
|
|
|
return
|
|
|
}
|
|
|
- if isShowJurisdiction == 1 && chartPermissionIds == "" {
|
|
|
- resp := new(models.GetCygxActivityListRep)
|
|
|
- page := paging.GetPaging(currentIndex, pageSize, 0)
|
|
|
- resp.Paging = page
|
|
|
- br.Ret = 200
|
|
|
- br.Success = true
|
|
|
- br.Msg = "获取成功"
|
|
|
- br.Data = resp
|
|
|
- return
|
|
|
- }
|
|
|
+
|
|
|
var userType int
|
|
|
var permissionStr string
|
|
|
if user.CompanyId <= 1 {
|
|
@@ -150,6 +141,11 @@ func (this *ActivityCoAntroller) ActivityList() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ fmt.Println(userType)
|
|
|
+ if isShowJurisdiction == 1 && chartPermissionIds == "" && userType == 4 {
|
|
|
+ activityTypeIds = "1,3"
|
|
|
+ }
|
|
|
+
|
|
|
fmt.Println(userType)
|
|
|
var startSize int
|
|
|
if pageSize <= 0 {
|
|
@@ -170,6 +166,7 @@ func (this *ActivityCoAntroller) ActivityList() {
|
|
|
if keyWord != "" {
|
|
|
condition += ` AND (art.activity_name LIKE '%` + keyWord + `%' )`
|
|
|
}
|
|
|
+
|
|
|
//行业名称
|
|
|
if len(chartPermissionIds) > 0 {
|
|
|
condition += ` AND art.chart_permission_id IN (` + chartPermissionIds + `)`
|
|
@@ -368,19 +365,19 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if userType == 3 {
|
|
|
- if !strings.Contains(permissionStr, "专家") && activityInfo.LimitPeopleNum > 0 && (!strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(3)) || activityInfo.CustomerTypeIds == "4") {
|
|
|
- br.Msg = "您暂无权限查看该活动"
|
|
|
- br.ErrMsg = "您暂无权限查看该活动,uid:" + strconv.Itoa(uid) + "activityId :" + strconv.Itoa(activityId)
|
|
|
- return
|
|
|
- }
|
|
|
- } else {
|
|
|
- if !strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(userType)) && activityInfo.LimitPeopleNum > 0 {
|
|
|
- br.Msg = "您暂无权限查看该活动"
|
|
|
- br.ErrMsg = "您暂无权限查看该活动,uid:" + strconv.Itoa(uid) + "activityId :" + strconv.Itoa(activityId)
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
+ //if userType == 3 {
|
|
|
+ // if !strings.Contains(permissionStr, "专家") && activityInfo.LimitPeopleNum > 0 && (!strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(3)) || activityInfo.CustomerTypeIds == "4") {
|
|
|
+ // br.Msg = "您暂无权限查看该活动"
|
|
|
+ // br.ErrMsg = "您暂无权限查看该活动,uid:" + strconv.Itoa(uid) + "activityId :" + strconv.Itoa(activityId)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ //} else {
|
|
|
+ // if !strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(userType)) && activityInfo.LimitPeopleNum > 0 {
|
|
|
+ // br.Msg = "您暂无权限查看该活动"
|
|
|
+ // br.ErrMsg = "您暂无权限查看该活动,uid:" + strconv.Itoa(uid) + "activityId :" + strconv.Itoa(activityId)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ //}
|
|
|
detail, errDetail := models.GetActivityTypeDetailById(activityInfo.ActivityTypeId)
|
|
|
if errDetail != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
@@ -433,15 +430,18 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
//1专家电话会、2分析师电话会、3公司调研电话会、4公司线下调研、5专家线下沙龙、6分析师线下沙龙
|
|
|
//OperationMode string `description:"操作方式 Apply:立即申请、Call:拨号 为空则为有权限"`
|
|
|
var havePower bool
|
|
|
- if (activityInfo.ActivityTypeId == 1 || activityInfo.ActivityTypeId == 3) && strings.Contains(permissionStr, "专家") && companyDetailStatus == "正式" {
|
|
|
+ if (activityInfo.ActivityTypeId == 1 || activityInfo.ActivityTypeId == 3) && strings.Contains(permissionStr, "专家") && activityInfo.LimitPeopleNum == 0 {
|
|
|
+ havePower = true
|
|
|
+ } else if activityInfo.ActivityTypeId == 3 && strings.Contains(permissionStr, "专家") && companyDetailStatus == "正式" && strings.Contains(activityInfo.CustomerTypeIds, "4") {
|
|
|
havePower = true
|
|
|
- } else if companyDetailStatus == "正式" && strings.Contains(permissionStr, "专家") && strings.Contains(activityInfo.CustomerTypeIds, "4") {
|
|
|
+ } else if activityInfo.ActivityTypeId == 3 && strings.Contains(permissionStr, "专家") && companyDetailStatus == "试用" && strings.Contains(activityInfo.CustomerTypeIds, "5") {
|
|
|
havePower = true
|
|
|
- } else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
|
|
|
+ } else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) && strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(userType)) {
|
|
|
havePower = true
|
|
|
- } else if strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(userType)) {
|
|
|
+ } else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) && activityInfo.LimitPeopleNum == 0 {
|
|
|
havePower = true
|
|
|
}
|
|
|
+
|
|
|
if havePower {
|
|
|
hasPermission = 1
|
|
|
resp.HaqveJurisdiction = true
|
|
@@ -616,13 +616,27 @@ func (this *ActivityCoAntroller) SignupAdd() {
|
|
|
//1专家电话会、2分析师电话会、3公司调研电话会、4公司线下调研、5专家线下沙龙、6分析师线下沙龙
|
|
|
//OperationMode string `description:"操作方式 Apply:立即申请、Call:拨号 为空则为有权限"`
|
|
|
var havePower bool
|
|
|
- if (activityInfo.ActivityTypeId == 1 || activityInfo.ActivityTypeId == 3) && strings.Contains(permissionStr, "专家") && companyDetailStatus == "正式" {
|
|
|
+ //if (activityInfo.ActivityTypeId == 1 || activityInfo.ActivityTypeId == 2 || activityInfo.ActivityTypeId == 3) && strings.Contains(permissionStr, "专家") && activityInfo.LimitPeopleNum == 0 {
|
|
|
+ // havePower = true
|
|
|
+ //} else if activityInfo.ActivityTypeId == 3 && strings.Contains(permissionStr, "专家") && companyDetailStatus == "正式" {
|
|
|
+ // havePower = true
|
|
|
+ //} else if strings.Contains(permissionStr, "专家") && strings.Contains(activityInfo.CustomerTypeIds, "4") {
|
|
|
+ // havePower = true
|
|
|
+ //} else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
|
|
|
+ // havePower = true
|
|
|
+ //} else if strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(userType)) {
|
|
|
+ // havePower = true
|
|
|
+ //}
|
|
|
+
|
|
|
+ if (activityInfo.ActivityTypeId == 1 || activityInfo.ActivityTypeId == 3) && strings.Contains(permissionStr, "专家") && activityInfo.LimitPeopleNum == 0 {
|
|
|
+ havePower = true
|
|
|
+ } else if activityInfo.ActivityTypeId == 3 && strings.Contains(permissionStr, "专家") && companyDetailStatus == "正式" && strings.Contains(activityInfo.CustomerTypeIds, "4") {
|
|
|
havePower = true
|
|
|
- } else if companyDetailStatus == "正式" && strings.Contains(permissionStr, "专家") && strings.Contains(activityInfo.CustomerTypeIds, "4") {
|
|
|
+ } else if activityInfo.ActivityTypeId == 3 && strings.Contains(permissionStr, "专家") && companyDetailStatus == "试用" && strings.Contains(activityInfo.CustomerTypeIds, "5") {
|
|
|
havePower = true
|
|
|
- } else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
|
|
|
+ } else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) && strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(userType)) {
|
|
|
havePower = true
|
|
|
- } else if strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(userType)) {
|
|
|
+ } else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) && activityInfo.LimitPeopleNum == 0 {
|
|
|
havePower = true
|
|
|
}
|
|
|
if havePower {
|
|
@@ -779,7 +793,7 @@ func (this *ActivityCoAntroller) SignupAdd() {
|
|
|
resp.MsgType = "Type"
|
|
|
resp.OperationMode = "Call"
|
|
|
if permissionStr == "专家" {
|
|
|
- resp.PopupMsg = "您暂无权限参加" + activityInfo.ActivityTypeName + "类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
+ resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
resp.MsgType = "Type"
|
|
|
} else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
|
|
|
resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
@@ -1155,13 +1169,27 @@ func (this *ActivityCoAntroller) MeetingReminderAdd() {
|
|
|
}
|
|
|
|
|
|
var havePower bool
|
|
|
- if (activityInfo.ActivityTypeId == 1 || activityInfo.ActivityTypeId == 3) && strings.Contains(permissionStr, "专家") && companyDetailStatus == "正式" {
|
|
|
+ //if activityInfo.ActivityTypeId == 1 && strings.Contains(permissionStr, "专家") {
|
|
|
+ // havePower = true
|
|
|
+ //} else if activityInfo.ActivityTypeId == 3 && activityInfo.LimitPeopleNum == 0 {
|
|
|
+ // havePower = true
|
|
|
+ //} else if strings.Contains(permissionStr, "专家") && strings.Contains(activityInfo.CustomerTypeIds, "4") {
|
|
|
+ // havePower = true
|
|
|
+ //} else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
|
|
|
+ // havePower = true
|
|
|
+ //} else if strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(userType)) {
|
|
|
+ // havePower = true
|
|
|
+ //}
|
|
|
+
|
|
|
+ if (activityInfo.ActivityTypeId == 1 || activityInfo.ActivityTypeId == 3) && strings.Contains(permissionStr, "专家") && activityInfo.LimitPeopleNum == 0 {
|
|
|
+ havePower = true
|
|
|
+ } else if activityInfo.ActivityTypeId == 3 && strings.Contains(permissionStr, "专家") && companyDetailStatus == "正式" && strings.Contains(activityInfo.CustomerTypeIds, "4") {
|
|
|
havePower = true
|
|
|
- } else if companyDetailStatus == "正式" && strings.Contains(permissionStr, "专家") && strings.Contains(activityInfo.CustomerTypeIds, "4") {
|
|
|
+ } else if activityInfo.ActivityTypeId == 3 && strings.Contains(permissionStr, "专家") && companyDetailStatus == "试用" && strings.Contains(activityInfo.CustomerTypeIds, "5") {
|
|
|
havePower = true
|
|
|
- } else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
|
|
|
+ } else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) && strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(userType)) {
|
|
|
havePower = true
|
|
|
- } else if strings.Contains(activityInfo.CustomerTypeIds, strconv.Itoa(userType)) {
|
|
|
+ } else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) && activityInfo.LimitPeopleNum == 0 {
|
|
|
havePower = true
|
|
|
}
|
|
|
if havePower {
|
|
@@ -1198,7 +1226,7 @@ func (this *ActivityCoAntroller) MeetingReminderAdd() {
|
|
|
resp.MsgType = "Type"
|
|
|
resp.OperationMode = "Call"
|
|
|
if permissionStr == "专家" {
|
|
|
- resp.PopupMsg = "您暂无权限参加" + activityInfo.ActivityTypeName + "类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
+ resp.PopupMsg = "您暂无权限参加【" + activityInfo.ActivityTypeName + "】类型活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|
|
|
resp.MsgType = "Type"
|
|
|
} else if strings.Contains(permissionStr, activityInfo.ChartPermissionName) {
|
|
|
resp.PopupMsg = "您暂无权限参加【" + activityInfo.ChartPermissionName + "】行业活动,若想参加请联系对口销售--" + companyItem.SellerName + ":" + companyItem.Mobile
|