vendredi 17 novembre 2017

Why won't my Laravel collection filter correctly by date?

I have

  $dt = Carbon::now();

  Event::orderBy('date', 'desc')
    ->where('date', '<', $dt->addWeeks(12))
    ->where('ends', '>=', $dt)
    ->orWhere('date', '>=', $dt)
    ->take(3)
    ->get();

All filters work except the first where. I tried it following the orWhere first, no dice. It displays items with the date in August 2018. Help?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2hJHlvo
via IFTTT

Aucun commentaire:

Enregistrer un commentaire