diff --git a/docker-compose.yml b/docker-compose.yml index d9d7f53fd..0123b7048 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,7 +27,7 @@ services: - "host.docker.internal:host-gateway" db: - image: mysql:5.6 + image: mysql:5.7 volumes: - db:/var/lib/mysql env_file: $PWD/src/.env diff --git a/src/.env.example b/src/.env.example index fa7b74204..cab4cd5d3 100644 --- a/src/.env.example +++ b/src/.env.example @@ -58,4 +58,4 @@ DISCORD_SCOPE= ## SEO SEO_DESCRIPTION= -SEO_KEYWORDS= \ No newline at end of file +SEO_KEYWORDS= diff --git a/src/app/Http/Controllers/HomeController.php b/src/app/Http/Controllers/HomeController.php index d16006051..0ade6c8de 100644 --- a/src/app/Http/Controllers/HomeController.php +++ b/src/app/Http/Controllers/HomeController.php @@ -3,12 +3,9 @@ namespace App\Http\Controllers; use DB; -use Auth; use App\Models\Event; use App\Models\NewsArticle; -use App\Models\EventTimetableData; -use App\Models\EventParticipant; class HomeController extends Controller { @@ -18,30 +15,6 @@ class HomeController extends Controller */ public function index() { - $topAttendees = array(); - foreach (EventParticipant::groupBy('user_id', 'event_id')->get() as $attendee) { - if ($attendee->event && $attendee->event->status == 'PUBLISHED' && $attendee->event->end < \Carbon\Carbon::today()) { - $recent = false; - if (!$attendee->user->admin && array_key_exists($attendee->user->id, $topAttendees)) { - $topAttendees[$attendee->user->id]->event_count++; - $recent = true; - } - if (!$attendee->user->admin && !$recent) { - $attendee->user->event_count = 1; - $topAttendees[$attendee->user->id] = $attendee->user; - } - } - } - usort($topAttendees, function ($a, $b) { - return $b['event_count'] <=> $a['event_count']; - }); - - $topWinners = array(); - - usort($topWinners, function ($a, $b) { - return $b['win_count'] <=> $a['win_count']; - }); - // TODO - TEMP FIX // Setup Slider Images $sliderImages = array( @@ -58,8 +31,6 @@ public function index() Event::where('end', '>=', \Carbon\Carbon::now()) ->orderBy(DB::raw('ABS(DATEDIFF(events.end, NOW()))'))->first() ) - ->withTopAttendees(array_slice($topAttendees, 0, 5)) - ->withTopWinners(array_slice($topWinners, 0, 5)) ->withNewsArticles(NewsArticle::limit(4)->orderBy('created_at', 'desc')->get()) ->withEvents(Event::all()) ->withSliderImages(json_decode(json_encode($sliderImages), FALSE)) diff --git a/src/resources/views/home.blade.php b/src/resources/views/home.blade.php index 8af5ca945..b18b31d51 100644 --- a/src/resources/views/home.blade.php +++ b/src/resources/views/home.blade.php @@ -132,43 +132,7 @@

The {{ config('app.name') }} Fam

@if (config('app.discord_id')) - - @endif - @if (count($topAttendees) > 0) - - @foreach ($topAttendees as $attendee) -
-
- {{ $attendee->username }}'s Avatar -
-
-

- {{ $attendee->username }}
- {{ $attendee->event_count }} Events Attended -

-
-
- @endforeach - @endif - @if (count($topWinners) > 0) - - @foreach ($topWinners as $winner) -
-
- {{ $winner->username }}'s Avatar -
-
-

- {{ $winner->username }}
- {{ $winner->win_count }} Wins -

-
-
- @endforeach + @endif