I have a code that brings the database data and generates a table. This data is coming all that are registered, but I need only the data with the same user state to come.
For example: I have a user from Santa Catarina, I need the data to come from the bank only from Santa Catarina.
My code is in CodeIgniter , and the Model that brings this information looks like this:
$this->datatables->select('lau.l_id, lau.l_tipo, emp.e_nome, lau.l_d_h, usr.usr_nome, lau.l_status');
$this->datatables->from('lau');
$this->datatables->join('usr', 'lau.u._id = usr.u._id');
$this->datatables->join('disp', 'lau.d_id = disp.d_id');
$this->datatables->join('emp', 'emp.e_id = usr.e_id');
return $this->datatables->generate();
}