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

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -