public function listEmpresas() { try { $telefone = new Contato(); $registros = $this->query('SELECT * FROM vw_empresas_sistema WHERE status = 1 ' . $this->cidade . $this->nome . $this->lat . $this->long); $i = 0; foreach ($registros as $registro) { $registros[$i] = array_merge($registro, array('telefones' => $telefone->findEmpresasContatos($registro['id']))); $i++; } return $registros; } catch (Exception $ex) { throw $ex; } }