Переглянути джерело

Merge branch 'dev/v1.1.49.1_wjh' of BaseService/jyMicroservices into hotfix/v1.1.49.1

wangjianghan 1 рік тому
батько
коміт
6c3680c64d
1 змінених файлів з 6 додано та 3 видалено
  1. 6 3
      jyBXSubscribe/rpc/model/push.go

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

@@ -705,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, ",")))
 			}
 		}