Tenho uma query em SQL Ansi:
select * from payments as P, receipts as R
where P.created_at < CURRENT_DATE AND P.updated_at < CURRENT_DATE AND R.created_at < CURRENT_DATE AND R.updated_at < CURRENT_DATE
Precioso realizar a mesma consulta no laravel:
public function relatorioBI(){
//1 A pagar
$query = $this->newQuery();
$query->where('created_at','1');
return $this->doQuery($query, $take, $paginate);
}
Preciso realiza a consulta nas duas tabelas, e testar o valor condicional!