bug 1391: adjusted query so that only the non administrative increase assurance are taken for the point calculation

This commit is contained in:
INOPIAE 2015-07-22 21:40:31 +02:00
parent 5a03b6f6f2
commit 1c5bceeae7

View file

@ -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';
$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;