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

append new group of conditions #57

Open
starking8b opened this issue Sep 27, 2022 · 1 comment
Open

append new group of conditions #57

starking8b opened this issue Sep 27, 2022 · 1 comment

Comments

@starking8b
Copy link

hello , I am trying to append a new group of conditions in the background and in this group, I want to use OR and the relation between this group and the group that was submitted by the user will be AND
so this is how it will work
group1 which is submitted by a user
group 2 which I want to add in the background
the relation between group1 and group2 is AND
and the conditions in group2 are OR
how can I do that? how can I push my conditions in the condition that the customer has been sent?

@geo903
Copy link

geo903 commented Oct 21, 2023

use it

            $table = \DB::table('clients');
            $table->select(\DB::raw($request_fields));
            $table->leftjoin('companies', 'clients.company_id', 'companies.id');
            $table->leftjoin('statuses', 'clients.status_id', 'statuses.id');
            $table->where('clients.project_id', '=', $settings['project_id']);

            $table->where(function ($query) use($condition){
                $qbp = new QueryBuilderParser();
                $query = $qbp->parse($condition, $query);
            });
            
            $clients=$table->get();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants