@php
$i=1;
$pre_point=0;
$point=0;
if (count($students)!=0){
if($type=='certificate'){
$pre_point =$students[0]->certificate_records_count;
}elseif($type=='courses'){
$pre_point =$students[0]->student_courses_count;
} elseif($type=='badge'){
$pre_point =$students[0]->user_badges_count;
} elseif($type=='level')
$pre_point =$students[0]->user_level;
elseif($type=='point'){
$pre_point =$students[0]->gamification_total_points;
}
}
@endphp
@foreach($students as $key=> $student)
@php
$point =0;
if($type=='certificate'){
$point =$student->certificate_records_count;
}elseif($type=='courses'){
$point = $student->student_courses_count;
} elseif($type=='badge'){
$point =$student->user_badges_count;
} elseif($type=='level')
$point = $student->user_level;
elseif($type=='point'){
$point = $student->gamification_total_points;
}
if ($pre_point>$point){
$i++;
$pre_point=$point;
}
if ($point==0){
continue;
}
@endphp
-
{{--
{{$i}}
--}}
{{$point}}
@if(!$modal)
{{pluralize($point,ucfirst($type=='courses'?'course':$type))}}
@endif
{{$i}}
@endforeach