Răsfoiți Sursa

Merge branch 'master' into feature/v1.1.50

lianbingjie 1 an în urmă
părinte
comite
b31f5ca479

+ 10 - 6
jyBXSubscribe/rpc/model/push.go

@@ -686,12 +686,14 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 				for _, v := range topType {
 					toptype = append(toptype, P.BidCodeMapping.Toptype[v])
 				}
-				if len(subtype) == 1 {
+				if len(topType) == 1 {
 					toptype = append(toptype, "9999")
 				}
 			} else {
 				for _, v := range stype {
-					subtype = append(subtype, P.BidCodeMapping.Subtype[v])
+					if P.BidCodeMapping.Subtype[v] != "" {
+						subtype = append(subtype, P.BidCodeMapping.Subtype[v])
+					}
 				}
 				if len(subtype) == 1 {
 					subtype = append(subtype, "9999")
@@ -703,10 +705,13 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 					toptype = append(toptype, "9999")
 				}
 			}
-			if len(subtype) > 0 {
+			if len(subtype) > 0 && len(toptype) > 0 {
+				s1 := fmt.Sprintf("(%s or %s)", fmt.Sprintf("a.subtype in (%s)", strings.Join(subtype, ",")),
+					fmt.Sprintf("a.toptype in (%s)", strings.Join(toptype, ",")))
+				querys = append(querys, s1)
+			} else if len(subtype) > 0 {
 				querys = append(querys, fmt.Sprintf("a.subtype in (%s)", strings.Join(subtype, ",")))
-			}
-			if len(toptype) > 0 {
+			} else if len(toptype) > 0 {
 				querys = append(querys, fmt.Sprintf("a.toptype in (%s)", strings.Join(toptype, ",")))
 			}
 		}
@@ -966,7 +971,6 @@ func getDetail(Mgo_bidding mongodb.MongodbSim, bidding, bidding_back string, sub
 	}
 }
 
-//
 func getInfosByIds(Mgo_bidding mongodb.MongodbSim, bidding, bidding_back string, isDetail bool, ids []string) map[string]map[string]interface{} {
 	infos := map[string]map[string]interface{}{}
 	//redis

+ 1 - 1
jyBXSubscribe/rpc/model/staffSubscribe.go

@@ -67,7 +67,7 @@ func GetStaffSubscribeList(entId, entUserId int, query string, eStatus, pStatus,
 	// 当检索是否有个人订阅时,因为无法关联查询,需要提前加载员工是否有个人订阅
 	pSubscribeList := getEntPersonOrderList(entId)
 	// 加载当前企业所有企业分发数据
-	ruleIds := getEntSubscirbeList(entId, userEnt.Dept.Id, userEnt.Role_admin_system)
+	ruleIds := getEntSubscirbeList(entId, userEnt.Dept.Id, (userEnt.Role_admin_system || userEnt.Role_admin_department))
 
 	allRule := ""
 	if len(ruleIds) > 0 {