|
@@ -256,6 +256,18 @@ func (this *ActivityCoAntroller) ActivityList() {
|
|
|
} else {
|
|
|
conditionOr += ` OR ( art.is_limit_people = 0 ` + condition + `) `
|
|
|
}
|
|
|
+
|
|
|
+ //判断客户规模是否属于可见范围的活动
|
|
|
+ companyProduct, err := models.GetCompanyProductDetail(user.CompanyId, 2)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if companyProduct.Scale != "" {
|
|
|
+ conditionOr += ` OR ( art.scale LIKE '%` + companyProduct.Scale + `%' ` + condition + `) `
|
|
|
+ }
|
|
|
+
|
|
|
condition += ` AND art.is_limit_people = 1 ` + permissionSqlStr + sqlExport + conditionOr
|
|
|
total, err := models.GetActivityCount(condition, pars)
|
|
|
if err != nil {
|
|
@@ -404,7 +416,6 @@ func (this *ActivityCoAntroller) ScheduleList() {
|
|
|
return
|
|
|
}
|
|
|
var list []*models.CygxActivityList
|
|
|
- fmt.Println(totalCount)
|
|
|
//全部都是进行中的活动
|
|
|
if totalCount > currentIndex*pageSize {
|
|
|
condition += ` AND art.active_state IN(2) `
|
|
@@ -432,7 +443,6 @@ func (this *ActivityCoAntroller) ScheduleList() {
|
|
|
br.ErrMsg = "获取失败,Err:" + errList.Error()
|
|
|
return
|
|
|
}
|
|
|
- fmt.Println("长度", len(listOther))
|
|
|
if len(listOther) > 0 {
|
|
|
for _, v := range listOther {
|
|
|
list = append(list, v)
|
|
@@ -651,6 +661,18 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ //获取用户的产业规模,判断是否允许可见
|
|
|
+ companyProduct, err := models.GetCompanyProductDetail(user.CompanyId, 2)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if companyProduct.Scale != "" {
|
|
|
+ if strings.Count(activityInfo.Scale, companyProduct.Scale) > 0 {
|
|
|
+ noPower = false
|
|
|
+ }
|
|
|
+ }
|
|
|
if noPower {
|
|
|
br.Msg = "您暂无查看该活动权限"
|
|
|
br.ErrMsg = "被分享客户不可见,获取信息失败"
|
|
@@ -685,7 +707,6 @@ func (this *ActivityCoAntroller) Detail() {
|
|
|
|
|
|
if user.CompanyId > 1 {
|
|
|
permissionStr, err := models.GetCompanyPermissionByUser(user.CompanyId)
|
|
|
- fmt.Println(permissionStr)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取客户权限信息失败,Err:" + err.Error()
|
|
@@ -2269,6 +2290,17 @@ func (this *ActivityCoAntroller) LabelTypeList() {
|
|
|
} else {
|
|
|
conditionOr += ` OR ( art.is_limit_people = 0 ` + condition + `) `
|
|
|
}
|
|
|
+ //判断客户规模是否属于可见范围的活动
|
|
|
+ companyProduct, err := models.GetCompanyProductDetail(user.CompanyId, 2)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if companyProduct.Scale != "" {
|
|
|
+ conditionOr += ` OR ( art.scale LIKE '%` + companyProduct.Scale + `%' ` + condition + `) `
|
|
|
+ }
|
|
|
+
|
|
|
condition += `AND art.is_limit_people = 1 ` + permissionSqlStr + sqlExport + conditionOr
|
|
|
|
|
|
sortTime = ` mintimesort ASC `
|
|
@@ -2418,6 +2450,16 @@ func (this *ActivityCoAntroller) LabelMoreList() {
|
|
|
} else {
|
|
|
conditionOr += ` OR ( art.is_limit_people = 0 ` + condition + `) `
|
|
|
}
|
|
|
+ //判断客户规模是否属于可见范围的活动
|
|
|
+ companyProduct, err := models.GetCompanyProductDetail(user.CompanyId, 2)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if companyProduct.Scale != "" {
|
|
|
+ conditionOr += ` OR ( art.scale LIKE '%` + companyProduct.Scale + `%' ` + condition + `) `
|
|
|
+ }
|
|
|
condition += `AND art.is_limit_people = 1 ` + permissionSqlStr + sqlExport + conditionOr
|
|
|
|
|
|
//进行中的活动
|
|
@@ -2609,6 +2651,16 @@ func (this *ActivityCoAntroller) ActivityListNew() {
|
|
|
} else {
|
|
|
conditionOr += ` OR ( art.is_limit_people = 0 ` + condition + `) `
|
|
|
}
|
|
|
+ //判断客户规模是否属于可见范围的活动
|
|
|
+ companyProduct, err := models.GetCompanyProductDetail(user.CompanyId, 2)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if companyProduct.Scale != "" {
|
|
|
+ conditionOr += ` OR ( art.scale LIKE '%` + companyProduct.Scale + `%' ` + condition + `) `
|
|
|
+ }
|
|
|
|
|
|
condition += ` AND art.is_limit_people = 1 ` + permissionSqlStr + sqlExport + conditionOr
|
|
|
total, err := models.GetActivityCount(condition, pars)
|
|
@@ -2843,6 +2895,16 @@ func (this *ActivityCoAntroller) LabelTypeListPc() {
|
|
|
} else {
|
|
|
conditionOr += ` OR ( art.is_limit_people = 0 ` + condition + `) `
|
|
|
}
|
|
|
+ //判断客户规模是否属于可见范围的活动
|
|
|
+ companyProduct, err := models.GetCompanyProductDetail(user.CompanyId, 2)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if companyProduct.Scale != "" {
|
|
|
+ conditionOr += ` OR ( art.scale LIKE '%` + companyProduct.Scale + `%' ` + condition + `) `
|
|
|
+ }
|
|
|
condition += `AND art.is_limit_people = 1 ` + permissionSqlStr + sqlExport + conditionOr
|
|
|
sortTime = ` mintimesort ASC `
|
|
|
labelList, err := models.GetActivityLabelListAll(condition, sortTime, pars, startSize, pageSize)
|