Hi all,
Hi guys, I am trying to do LeftJoin of two data sets and I am getting error Message: Invalid argument supplied for foreach()
My code looks like this:
// 1st
$stanjeRobe = $this->src('automaker')
->query($prodaja_radnje['priprema'])
->params(array(
":korisnik"=>$dodDobavljac
)) // ;
->pipe($this->dataStore("stanjeRobe"));
// 2nd store
$prodajaRadnje = $this->src('automaker')
->query($prodaja_radnje['sve'])
->params(array(
":korisnik"=>$dodDobavljac,
":start"=>$this->params["dateRange"][0],
":end"=>$this->params["dateRange"][1],
))//;
->pipe($this->dataStore("prometRobe"));
$new_store = $this->dataStore('prometRobe')->leftJoin($this->dataStore('stanjeRobe'),array(
"SifraMat"=>"SifraMat"
));
I have tried this way as well, same thig but a bit different:
// ## 1st
$this->src('automaker')
->query($prodaja_radnje['priprema'])
->params(array(
":korisnik"=>$dodDobavljac
))
->pipe($this->dataStore("stanjeRobe"));
// ## 2nd
$this->src('automaker')
->query($prodaja_radnje['sve'])
->params(array(
":korisnik"=>$dodDobavljac,
":start"=>$this->params["dateRange"][0],
":end"=>$this->params["dateRange"][1],
))
->pipe($this->dataStore("prodajaRadnje"));
// this throws an error: Message: Invalid argument supplied for foreach()
$new_store = $this->dataStore('prodajaRadnje')->leftJoin($this->dataStore('stanjeRobe'),array(
"SifraMat"=>"SifraMat"
));
I am using Join for now, as below and works fine but I need left join to have correct data.
$join = new Join($stanjeRobe,$prodajaRadnje,array(
"SifraMat"=>"SifraMat","BrojSklad"=>"BrojSklad"
));
Is there something different in documentation (https://www.koolreport.com/docs/datastore/overview/#join-methods-leftjoin) that I am missing or I did not use it properly here.
I don't get what argument I have to provide, there is no documentation for it (not one which works)
Note: MySQL query with JOIN takes ages to execute and this Join is my only bet (for now).