TourController: Touren nach Datum sortieren (orderBy)
This commit is contained in:
parent
9526e2f744
commit
60177901c6
1 changed files with 2 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ class TourController extends Controller
|
|||
public function index()
|
||||
{
|
||||
error_log("Tour:index");
|
||||
$tours=Tour::where('start','>',Carbon::now())->get();
|
||||
$tours=Tour::where('start','>',Carbon::now())->orderBy('start')->get();
|
||||
$participantCount=array();
|
||||
foreach($tours as $tour) {
|
||||
$result = DB::select('select count(*) as cnt from bookings where tour_id=?', [$tour->id]);
|
||||
|
|
@ -35,7 +35,7 @@ class TourController extends Controller
|
|||
public function index_old()
|
||||
{
|
||||
error_log("Tour:index_old");
|
||||
$tours=Tour::where('start','<',Carbon::now())->get();
|
||||
$tours=Tour::where('start','<',Carbon::now())->orderBy('start')->get();
|
||||
$participantCount=array();
|
||||
foreach($tours as $tour) {
|
||||
$result = DB::select('select count(*) as cnt from bookings where tour_id=?', [$tour->id]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue