From 37b862d1a62230ad02081719ccef335757be2571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Oudin?= <oudin@crans.org> Date: Fri, 6 Dec 2019 18:38:20 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20des=20tarif=20des=20cont?= =?UTF-8?q?reparties?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/LQDN/Handler/UserHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LQDN/Handler/UserHandler.php b/src/LQDN/Handler/UserHandler.php index 8dd237b..0097651 100644 --- a/src/LQDN/Handler/UserHandler.php +++ b/src/LQDN/Handler/UserHandler.php @@ -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]); -- GitLab