Verified Commit 37b862d1 authored by Guinness's avatar Guinness

Mise à jour des tarif des contreparties

parent 887cfa6e
......@@ -116,7 +116,7 @@ class UserHandler
// quoi = 'pibag' somme = 50
// quoi = 'piplome' somme = 30
$spent = $this->connection->executeQuery(
"SELECT sum(IF(quoi = 'hoodie',250,0)) + sum(IF(quoi = 'pishirt', 100, 0)) + sum(IF(quoi = 'pibag', 50, 0)) + sum(IF(quoi = 'piplome', 30, 0)) AS spent FROM contreparties WHERE user_id = :user_id AND id = parent",
"SELECT sum(IF(quoi = 'hoodie',314,0)) + sum(IF(quoi = 'pishirt', 128, 0)) + sum(IF(quoi = 'pibag', 64, 0)) + sum(IF(quoi = 'piplome', 32, 0)) AS spent FROM contreparties WHERE user_id = :user_id AND id = parent",
[ 'user_id' => $user_id]
)->fetchAll(\PDO::FETCH_COLUMN)[0];
$this->connection->executeUpdate('UPDATE users SET total = :total, cumul = :cumul WHERE id = :user_id', ['total' => (int) $total, 'cumul' => (int) $total - (int) $spent, 'user_id' => $user_id]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment