I want to get user rank position based on the total score and average time. but the query I am using its provide wrong postion number
$myId = TotalScore::where('user_id', $user_id)->first();
$position = TotalScore::where('ts', '>=', $myId->ts)->where('avg_times_taken', '>=', $myId->avg_times_taken)->count();
this is the code I am using.
this is the table structure I am using.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire