PDO - Join in a function

1

I am inserting a new query into a functional system, but I am not able to understand how to insert a JOIN , I saw the function exists, I just can not deploy it.

I tried to run like this

$query_cliente  = QB::table('tbl_reclamacoes')->join('tbl_usuarios','id_usuarios','id_cadastro_reclamacoes')->where('id_reclamacoes','=',$get_id);

But it did not work, I already tried it in other ways, but I do not think I understood.

 public function join($table, $key, $operator = null, $value = null, $type = 'inner')
{
    if (!$key instanceof \Closure) {
        $key = function ($joinBuilder) use ($key, $operator, $value) {
            $joinBuilder->on($key, $operator, $value);
        };
    }


    $joinBuilder = $this->container->build('\Pixie\QueryBuilder\JoinBuilder', array($this->connection));
    $joinBuilder = & $joinBuilder;       
    $key($joinBuilder);
    $table = $this->addTablePrefix($table, false);       
    $this->statements['joins'][] = compact('type', 'table', 'joinBuilder');
    return $this;
}
    
asked by anonymous 27.12.2018 / 13:09

0 answers