summaryrefslogtreecommitdiff
path: root/manager
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2015-07-31 08:04:11 +0200
committerBenny Baumann <BenBE@geshi.org>2015-07-31 08:05:00 +0200
commit3c8663a208346f502173a4b123d98120869b0765 (patch)
tree8f7a504a7589450b3fd9d083013aba5809340a6a /manager
parente6af0ab4c954758ca368aadcafdba43361974498 (diff)
downloadcacert-mgr-3c8663a208346f502173a4b123d98120869b0765.tar.gz
cacert-mgr-3c8663a208346f502173a4b123d98120869b0765.tar.xz
cacert-mgr-3c8663a208346f502173a4b123d98120869b0765.zip
bug 1391: fix sql statement
Diffstat (limited to 'manager')
-rw-r--r--manager/application/models/User.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/manager/application/models/User.php b/manager/application/models/User.php
index 53711f9..f8ebf60 100644
--- a/manager/application/models/User.php
+++ b/manager/application/models/User.php
@@ -108,8 +108,8 @@ class Default_Model_User {
* user's points
*/
public function refreshPoints() {
- $query = "select sum(`points`) as `total` from `notary` " .
- "where `to` = :user and method != 'Administrative Increase' and from != to";
+ $query = "SELECT SUM(`points`) AS `total` FROM `notary` " .
+ "WHERE `to` = :user AND `method` != 'Administrative Increase' AND `from` != `to`";
$query_params['user'] = $this->id;
$row = $this->db->query($query, $query_params)->fetch();
if ($row['total'] === null) $row['total'] = 0;