forked from halo-battle/game
Ajout du code pour mettre à jour le classement via postgresql aussi
This commit is contained in:
parent
52e99ddea8
commit
4cda71a337
@ -196,4 +196,14 @@ class BDD
|
||||
|
||||
return pg_affected_rows($this->reponse);
|
||||
}
|
||||
|
||||
public function update_classement()
|
||||
{
|
||||
if (!$this->session) {
|
||||
return false;
|
||||
}
|
||||
global $table_user;
|
||||
$query = "UPDATE $table_user SET place_points=subquery.rn FROM (SELECT id, points, place_points, row_number() over (order by points DESC) as rn FROM $table_user) AS subquery WHERE $table_user.id=subquery.id;";
|
||||
pg_query($this->session, $query);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user