@extends('backend.layouts.app') @section('content')

{{ translate('Leaderborad') }}

{{ translate('User Details') }}

@if ($users->count() > 0) @foreach ($users as $user) @php $quizzes = \App\Models\QuizParticipant::where('user_id', $user->id)->with('quiz.questions')->get(); $totalWins = 0; $totalQuizzes = $quizzes->count(); $quizzes->each(function ($quizParticipant) use (&$totalWins) { $quizId = $quizParticipant->quiz_id; $totalQuestions = $quizParticipant->quiz->questions->count(); $correctAnswersCount = \App\Models\QuizContest::where('quiz_id', $quizId) ->where('user_id', auth()->id()) ->where('is_correct', 1) ->count(); if ($correctAnswersCount == $totalQuestions) { $totalWins++; } }); @endphp {{ $user->isBanned() }} @endforeach @else @endif
{{ translate('#') }} {{ translate('Profile') }} {{ translate('Name') }} {{ translate('Email') }} {{ translate('Mobile') }} {{ translate('Points') }} {{ translate('Wallet') }} {{ translate('Life') }} {{ translate('Life Special') }} {{ translate('Hint') }} {{ translate('Hint Special') }} {{ translate('Play Quiz') }} {{ translate('Action') }}
{{ str_pad($user->id, 5, '0', STR_PAD_LEFT) }} @if (empty($user->image)) @else Profile @endif {{ $user->first_name . ' ' . $user->last_name }} {{ $user->email }} {{ $user->phone }} {{ $user->points }} {{ $user->wallet_amount }} {{ $user->life }} {{ $user->life_special }} {{ $user->hint }} {{ $user->hint_special }}
@if (!$user->isBanned())
@csrf
@else
@csrf
@endif
{{translate('No users available.')}}
@include('backend.modals.delete') @endsection @section('script') @endsection