Make the segment work with ALL condition

[MAILPOET-3955]
This commit is contained in:
Pavel Dohnal
2021-12-02 12:24:06 +01:00
committed by Veljko V
parent d541edc865
commit c5d994dbf0
2 changed files with 29 additions and 4 deletions

View File

@@ -50,7 +50,6 @@ class UserRole implements Filter {
return $qb;
}
/**
* @param string[] $roles
* @param string $operator
@@ -66,7 +65,7 @@ class UserRole implements Filter {
$sqlParts[] = '(wpusermeta.meta_value LIKE :role' . $key . $parameterSuffix . ')';
}
}
if ($operator === DynamicSegmentFilterData::OPERATOR_NONE) {
if (($operator === DynamicSegmentFilterData::OPERATOR_NONE) || ($operator === DynamicSegmentFilterData::OPERATOR_ALL)) {
return join(' AND ', $sqlParts);
}
return join(' OR ', $sqlParts);