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

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -