Browse Source

Merge branch 'cygx_9.3.1_0' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 2 years ago
parent
commit
8e09543b8e
1 changed files with 17 additions and 0 deletions
  1. 17 0
      services/activity.go

+ 17 - 0
services/activity.go

@@ -428,6 +428,18 @@ func GetActivityDetailUserPower(user *models.WxUserItem, activityInfo *models.Ac
 			}
 		}
 	}
+	//判断管理规模是否满足
+	companyProduct, e := models.GetCompanyProductDetail(user.CompanyId, 2)
+	if e != nil {
+		err = e
+		return
+	}
+	if companyProduct != nil && activityInfo.Scale != "" {
+		if strings.Contains(activityInfo.Scale, companyProduct.Scale) {
+			havePower = true
+		}
+	}
+
 	if user.CompanyId <= 1 {
 		return
 	} else {
@@ -815,6 +827,11 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 	//查询全部可见的数据(是否全部客户可见)
 	//condition += ` AND art.visible_range != 1  AND art.publish_status = 1 `
 	condition += `   AND art.publish_status = 1 `
+	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 ))  `
+	}
 
 	conditionHz = condition
 	//活动仅决策人可见