feat: Add OR logic support to user fetch API filters#789
Open
socksprox wants to merge 1 commit intocedar2025:masterfrom
Open
feat: Add OR logic support to user fetch API filters#789socksprox wants to merge 1 commit intocedar2025:masterfrom
socksprox wants to merge 1 commit intocedar2025:masterfrom
Conversation
Author
|
@cedar2025 👀make sure not to forget my pull requests :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added support for OR logic between filters in the user/fetch endpoint while maintaining full backward compatibility with existing API clients.
Features
Examples
Find users in multiple groups (OR logic)
{ "filter": [ { "id": "group_id", "value": [1, 2, 3, 4], "logic": "or" } ] }Find users with high traffic OR expired accounts
{ "filter": [ { "id": "total_used", "value": "gt:107374182400" }, { "id": "expired_at", "value": "lt:1706400000", "logic": "or" } ] }Backward compatible (legacy format still works)
{ "filter": [ { "id": "id", "value": "gt:13" }, { "id": "total_used", "value": "gt:10737418240" } ] }Changes
applyFiltersmethod inUserController.phpto support optionallogicparameterlogicis not specified, defaults to 'and' (preserves existing behavior)logic: 'or'is specified, usesorWhereinstead ofwhereBackward Compatibility
✅ All existing API calls continue to work without any changes
✅ Legacy frontends require no modifications
✅ Only new requests with explicit
logic: 'or'will use OR logic