|
@@ -215,38 +215,19 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
|
|
|
//查询全部可见的数据(是否全部客户可见)
|
|
|
//condition += ` AND art.visible_range != 1 AND art.publish_status = 1 `
|
|
|
condition += ` AND art.publish_status = 1 `
|
|
|
-
|
|
|
- // 8: 行业升级套餐客户:该活动对应行业为升级权限的客户
|
|
|
-
|
|
|
- ////9:其他行业正式客户:前述所有正式客户以外的正式客户 查询处理
|
|
|
-
|
|
|
- conditionShengji, conditionZhengshi, conditionHangYe, e := ActivityLabelSpecialUserSql(user)
|
|
|
- if e != nil {
|
|
|
- err = errors.New("ActivityLabelSpecialUserSql, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if conditionShengji != "" {
|
|
|
- conditionOr += ` OR ( art.is_limit_people = 1 AND ` + conditionShengji + condition + ` ) `
|
|
|
- }
|
|
|
- if conditionZhengshi != "" {
|
|
|
- conditionOr += ` OR ( art.is_limit_people = 1 AND ` + conditionZhengshi + condition + ` ) `
|
|
|
- }
|
|
|
- if conditionHangYe != "" {
|
|
|
- conditionOr += ` OR ( art.is_limit_people = 1 AND ` + conditionHangYe + condition + ` ) `
|
|
|
- }
|
|
|
- fmt.Println(conditionShengji)
|
|
|
- fmt.Println(conditionZhengshi)
|
|
|
- fmt.Println(conditionHangYe)
|
|
|
-
|
|
|
+ //if adminIds == "" {
|
|
|
+ // //condition += ` AND art.visible_range != 1 `
|
|
|
+ //} else {
|
|
|
+ // condition += ` AND ( art.visible_range != 1 OR ( art.admin_id IN ( ` + adminIds + ` ) AND art.visible_range = 1 )) `
|
|
|
+ //}
|
|
|
+ condition += ` AND ( art.visible_range != 1 OR ( art.admin_id IN ( ` + adminIds + ` ) AND art.visible_range = 1 )) `
|
|
|
conditionHz = condition
|
|
|
-
|
|
|
//活动仅决策人可见
|
|
|
if isMaker == 0 {
|
|
|
condition += ` AND art.is_maker_show = 0 `
|
|
|
}
|
|
|
conditionAdmin = condition + ` AND art.visible_range = 1 `
|
|
|
- condition += ` AND art.visible_range != 1 `
|
|
|
+ //condition += ` AND art.visible_range != 1 `
|
|
|
if (userType == 2 || userType == 3 || userType == 4) && strings.Contains(permissionStr, "专家") {
|
|
|
conditionOr += ` OR ( art.is_limit_people = 1 AND art.customer_type_ids LIKE '%4%' ` + condition + `) `
|
|
|
}
|
|
@@ -268,7 +249,10 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
|
|
|
}
|
|
|
|
|
|
if adminIds != "" {
|
|
|
- conditionOr += ` OR ( art.customer_type_ids LIKE '%` + strconv.Itoa(userType) + `%' ` + ` AND art.admin_id IN (` + adminIds + `) ` + conditionAdmin + `) `
|
|
|
+ if userType == 3 {
|
|
|
+ conditionAdmin += ` AND art.chart_permission_name IN (` + permissionNameStr + `) `
|
|
|
+ }
|
|
|
+ conditionOr += ` OR ( art.customer_type_ids LIKE '%` + userTypeStr + `%' ` + ` AND art.admin_id IN (` + adminIds + `) ` + conditionAdmin + `) `
|
|
|
if companyProduct != nil {
|
|
|
if companyProduct.Scale != "" {
|
|
|
conditionOr += ` OR ( art.scale LIKE '%` + companyProduct.Scale + `%'` + ` AND art.admin_id IN (` + adminIds + `) ` + conditionAdmin + `) `
|
|
@@ -276,8 +260,23 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ conditionShengji, conditionZhengshi, conditionHangYe, e := ActivityLabelSpecialUserSql(user)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("ActivityLabelSpecialUserSql, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if conditionShengji != "" {
|
|
|
+ conditionOr += ` OR ( art.is_limit_people = 1 AND ` + conditionShengji + condition + ` ) `
|
|
|
+ }
|
|
|
+ if conditionZhengshi != "" {
|
|
|
+ conditionOr += ` OR ( art.is_limit_people = 1 AND ` + conditionZhengshi + condition + ` ) `
|
|
|
+ }
|
|
|
+ if conditionHangYe != "" {
|
|
|
+ conditionOr += ` OR ( art.is_limit_people = 1 AND ` + conditionHangYe + condition + ` ) `
|
|
|
+ }
|
|
|
+
|
|
|
//弘则研究下的客户不做权限,限制,C类电话会,仅本组销售、部门管理员、admin、权益研究员账号能看到
|
|
|
- if user.CompanyId == 16 {
|
|
|
+ if user.CompanyId == utils.HZ_COMPANY_ID {
|
|
|
mapMobile, e := GetAdminMobileMap()
|
|
|
if e != nil {
|
|
|
err = e
|
|
@@ -287,7 +286,9 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
|
|
|
conditionOr += ` OR ( art.publish_status = 1 ` + conditionHz + `) `
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if userType == 3 {
|
|
|
+ condition += ` AND art.chart_permission_name IN (` + permissionNameStr + `) `
|
|
|
+ }
|
|
|
conditionActivity = condition + permissionSqlStr + sqlExport + conditionOr
|
|
|
return
|
|
|
}
|