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

group_start and or_group_start implementation #129

Open
eliasmcastro opened this issue Jan 29, 2018 · 2 comments
Open

group_start and or_group_start implementation #129

eliasmcastro opened this issue Jan 29, 2018 · 2 comments

Comments

@eliasmcastro
Copy link

Hello, i'm trying to make some complex query but i'm facing some issues.

I'm using "group_start" in CodeIgniter, but when I use Ignited-Datatables I don't find "group_start" and "or_group_start", my query is complex and need of use "(" and ")". How fix the issue?

Thanks.

@wrabit
Copy link

wrabit commented Jul 12, 2018

You could open up the Datatables library and add the methods yourself:

    public function group_start($not = '', $type = 'AND ')
    {
      $this->ci->db->group_start($not, $type);
      return $this;
    }
    public function or_group_start()
    {
      $this->ci->db->or_group_start();
      return $this;
    }
    public function group_end()
    {
      $this->ci->db->group_end();
      return $this;
    }

@briansulzen
Copy link

Any idea how to get group_start and group_end methods to get the correct count in get_total_results? Generating the query works by adding the CI methods to the Datatables library as suggested by @wrabit , but the count generated by get_total_results is way off. Trying to come up with a solution that is not hacky to add group_start and group_end into get_total_results

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

3 participants