diff --git a/motorradig/app/Http/Controllers/TourController.php b/motorradig/app/Http/Controllers/TourController.php index 6c990d5..9f57aac 100644 --- a/motorradig/app/Http/Controllers/TourController.php +++ b/motorradig/app/Http/Controllers/TourController.php @@ -24,6 +24,9 @@ public function index() { error_log("Tour:index"); + + + $tours = Tour::where('start', '>', Carbon::now())->orderBy('start')->get(); $participantCount = array(); foreach ($tours as $key => $tour) { @@ -37,16 +40,22 @@ public function index_old() { - error_log("Tour:index_old"); + Log::info("Tour:index_old"); $tours = Tour::where('start', '<', Carbon::now())->orderBy('start')->get(); $participantCount = array(); + $imagecount_per_tour = array(); foreach ($tours as $key => $tour) { $result = DB::select('select count(*) as cnt from bookings where tour_id=?', [$tour->id]); $participantCount[$tour->id] = $result[0]->cnt; $tours[$key]->start = Tour::toGermanDate($tour->start); $tours[$key]->deadline = Tour::toGermanDate($tour->deadline); + + $imagelist = Storage::disk('img_storage')->files("tour-$tour->id"); + $len = sizeof($imagelist)/2; + $imagecount_per_tour[$tour->id]=$len; + Log::info("Tour $tour->id, ImageList size: $len"); } - return view('tour.index_old')->with('tours', $tours)->with('participantCount', $participantCount); + return view('tour.index_old')->with('tours', $tours)->with('participantCount', $participantCount)->with('imagecount_per_tour', $imagecount_per_tour); } diff --git a/motorradig/resources/views/tour/index_old.blade.php b/motorradig/resources/views/tour/index_old.blade.php index ca73621..55a26f1 100644 --- a/motorradig/resources/views/tour/index_old.blade.php +++ b/motorradig/resources/views/tour/index_old.blade.php @@ -12,13 +12,14 @@
.