QueryBuilderParser
QueryBuilderParser copied to clipboard
append new group of conditions
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?
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();