Explorar el Código

Merge branch 'dev/v1.1.21_wh' of BaseService/jyMicroservices into feature/v1.1.21

王浩 hace 2 años
padre
commit
a7d2fae6e5
Se han modificado 1 ficheros con 9 adiciones y 6 borrados
  1. 9 6
      jyBXSubscribe/rpc/model/push.go

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

@@ -495,16 +495,19 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 		}
 		//关键词
 		find_in_set := []string{}
-		if spqp.PositionType == 0 {
-			for _, v := range strings.Split(spqp.Key, ",") {
-				find_in_set = append(find_in_set, fmt.Sprintf("find_in_set('%s',replace(replace(a.matchkeys,'+',','),' ',','))", v))
+		if spqp.IsEnt {
+			if spqp.Key != "" {
+				for _, v := range strings.Split(spqp.Key, ",") {
+					find_in_set = append(find_in_set, fmt.Sprintf("find_in_set('%s',replace(replace(a.matchkeys,'+',','),' ',','))", v))
+				}
 			}
-			for _, v := range strings.Split(spqp.Item, ",") {
-				find_in_set = append(find_in_set, fmt.Sprintf("find_in_set('%s',replace(replace(a.matchitems,'+',','),' ',','))", v))
+			if spqp.Item != "" {
+				for _, v := range strings.Split(spqp.Item, ",") {
+					find_in_set = append(find_in_set, fmt.Sprintf("find_in_set('%s',replace(replace(a.matchitems,'+',','),' ',','))", v))
+				}
 			}
 		} else {
 			if spqp.Key != "" {
-				find_in_set := []string{}
 				for _, v := range strings.Split(spqp.Key, ",") {
 					find_in_set = append(find_in_set, fmt.Sprintf("find_in_set('%s',replace(replace(a.matchkeys,'+',','),' ',','))", v))
 				}