db->from('customer_account_opening_requests')->where('status',$state); if(!empty($validating_agent_id)){ $query = $query->where('validating_agent_id', $validating_agent_id); } if(!empty($network_id)){ $query = $query->where('network_id', $network_id); } return $query->count_all_results(); } public function getInfosOpeningAccountRequestId($requestId){ return $this->db->get_where('infos_customer_account_opening_requests',['id' => $requestId])->first_row(); } public function getOpeningAccountRequestDocuments($requestId){ return $this->db->get_where('customer_account_request_documents',['request_id' => $requestId])->result(); } }