Jump to content


top filter doesn't work with use or_where

or_where top filter bug

  • Please log in to reply
No replies to this topic

#1 matiasrj

matiasrj

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 21 December 2019 - 10:27 AM

Hello, 

 

I have problem when I want to use top filter after of implement an or_where condition.

 

$crud = new grocery_CRUD();

$crud->unset_edit();
$crud->unset_delete();
$crud->unset_read();
$crud->unset_add();
   
$crud->set_table("tbl_ope");
$crud->set_subject("Operaciones");
$crud->columns(["id","status","tbl_tipo_ope_id","tbl_client_id","dt_start", "dt_finish", "tbl_reg_name"]);

$crud->set_relation("status", "tbl_ope", "status");
$crud->set_relation("id", "tbl_ope", "id");
$crud->set_relation("tbl_client_id", "tbl_client", "name");
$crud->set_relation("tbl_tipo_ope_id", "tbl_tipo_ope", "name_tipo");

$client_list= $this->db->select("tbl_client_id")
                             ->distinct("tbl_client_id")
                            ->get_where("user_client",array ('users_id' => $user_id));
 
$array_aux=$client_list->result_array();
 
for ($i=0; $i<sizeof($array_aux); $i++)
        {
         if ($i==0) {
                   $crud->where('tbl_ope.tbl_client_id',$array_aux[$i]['tbl_client_id'] ) ;
                   
                     }
         else      $crud->or_where('tbl_ope.tbl_client_id',$array_aux[$i]['tbl_client_id']);
        }
$crud->display_as("tbl_reg_name", "Tabla de registro");
$crud->display_as("tbl_tipo_ope_id", "Tipo de Operacion");
$crud->display_as("tbl_client_id", "Cliente");

$crud->unset_clone();
$output = $crud->render();

 

    

 

 

When I use just where ($i==0), filters top works.

But the problem  appear when or_where is applied.







Also tagged with one or more of these keywords: or_where, top filter bug

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users