php - Group by portion not appears in codeigniter datatable query -
i trying use group in datatable query per below:
but group portion not appears in query printed.
datatable query:
$this->datatables->select('banks_users.id,users.created_at,username'); $this->datatables->from('banks_users'); $this->datatables->join('users', 'banks_users.users_id = users.id', 'left outer'); $this->datatables->join('banks', 'banks.id = banks_users.banks_id', 'left outer'); $this->datatables->join('branches_agents', 'branches_agents.users_id = users.id'); $this->datatables->join('branches', 'branches.id = branches_agents.branches_id'); $this->datatables->join('banks_countries', 'banks_countries.banks_id = banks_users.banks_id', 'left outer'); $this->datatables->join('countries', 'countries.id = banks_countries.countries_id', 'left outer'); $this->datatables->where('users.user_type', 'bank'); $this->datatables->group_by('banks_users.id'); $data = json_decode($this->datatables->generate());
but dont consider group by
, generates query like:
select count(*) numrows banks_users left outer join users on banks_users.users_id = users.id left outer join banks on banks.id = banks_users.banks_id join branches_agents on branches_agents.users_id = users.id join branches on branches.id = branches_agents.branches_id left outer join banks_countries on banks_countries.banks_id = banks_users.banks_id left outer join countries on countries.id = banks_countries.countries_id users.user_type = 'bank'
so, please help...
Comments
Post a Comment