Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more filter keyword to "or" filter #6

Closed
LIQRGV opened this issue Nov 23, 2019 · 0 comments · Fixed by #7
Closed

Add more filter keyword to "or" filter #6

LIQRGV opened this issue Nov 23, 2019 · 0 comments · Fixed by #7
Labels
enhancement New feature or request

Comments

@LIQRGV
Copy link
Owner

LIQRGV commented Nov 23, 2019

As enhancement for #3, we should allow "or" filter to use another keyword too.

Currently we have this filter keyword:

    private static $WHERE_QUERY_MAPPING = [
        "in" => "whereIn",
        "!in" => "whereNotIn",
        "between" => "whereBetween",
    ];

So, basically we should able transform this query param:
x_model?filter[a|b][is]=1&filter[c|d][in]=1,2,3&filter[e|f][!in]=4,5,6&filter[g|h][between]=7,8&filter[i][between]=9,10

into this filter

......  where 
            (a = 1 or b = 1) and 
            (c in (1,2,3) or d in (1,2,3)) and 
            (e not in (4,5,6) or f not in (4,5,6)) and 
            (g between 7 and 8 or h between 7 and 8) and 
            i between 9 and 10;
@LIQRGV LIQRGV added the enhancement New feature or request label Nov 23, 2019
@LIQRGV LIQRGV closed this as completed in #7 Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant