bug 1391: fix sql statement
This commit is contained in:
parent
e6af0ab4c9
commit
3c8663a208
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue