php - Multiple Where using Querys in Laravel -
php - Multiple Where using Querys in Laravel -
i have code :
if ($tipo==='d') { $movimentos=movimento::where('tipo',$d)->wherein('destino',$idcontas)->wherebetween('data', [$compdata, carbon::now()])->get(); } elseif ($tipo==='c') { $movimentos=movimento::where('tipo',$d)->wherein('origem',$idcontas)->wherebetween('data', [$compdata, carbon::now()])->get(); } else { $movimentos=movimento::where('tipo',$d)->wherein('origem',$idcontas)->wherein('destino',$idcontas)->wherebetween('data', [$compdata, carbon::now()])->get(); }
i've seen lot of posts regarding multiple in laravel not single 1 talking special wheres. code have atm doesnt work if have 1 wherebetween 1 does.
can help me making them working fine?
php mysql laravel where
Comments
Post a Comment