Browse Source

no message

xingzai 8 months ago
parent
commit
bda44594f5
1 changed files with 12 additions and 11 deletions
  1. 12 11
      controllers/company_share.go

+ 12 - 11
controllers/company_share.go

@@ -194,17 +194,18 @@ func (this *CompanyController) CompanyShareList() {
 						condition += ` AND b.group_id IN (` + groupIdStr + `) `
 					}
 				}
-			} else if sysUser.Authority == 4 || roleTypeCode == utils.ROLE_TYPE_CODE_RAI_GROUP {
-				if sysUser.GroupId == groupId {
-					sellerIdStr, err := services.GetFiccSellerIdsByGroupId(sysUser.GroupId)
-					if err != nil {
-						br.Msg = "获取销售分组信息失败!"
-						br.ErrMsg = "获取销售分组信息失败!Err:" + err.Error()
-						return
-					}
-					if sellerIdStr != "" {
-						condition += ` AND b.share_seller_id IN (` + sellerIdStr + `) `
-					}
+			} else if roleTypeCode == utils.ROLE_TYPE_CODE_RAI_GROUP {
+				//if sysUser.GroupId == groupId {
+				sellerIdStr, err := services.GetFiccSellerIdsByGroupId(sysUser.GroupId)
+				if err != nil {
+					br.Msg = "获取销售分组信息失败!"
+					br.ErrMsg = "获取销售分组信息失败!Err:" + err.Error()
+					return
+				}
+				//权益销售组长可以查看自己的组员以及共享给组员的客户
+				if sellerIdStr != "" {
+					condition += ` AND ( b.share_seller_id IN (` + sellerIdStr + `)  OR   b.group_id= ? )`
+					pars = append(pars, sysUser.GroupId)
 				} else {
 					condition += ` AND b.group_id=? `
 					pars = append(pars, sysUser.GroupId)