bug 1391: added range check for points
This commit is contained in:
parent
3c8663a208
commit
7239b831f8
1 changed files with 13 additions and 0 deletions
|
@ -115,6 +115,19 @@ class Default_Model_User {
|
||||||
if ($row['total'] === null) $row['total'] = 0;
|
if ($row['total'] === null) $row['total'] = 0;
|
||||||
|
|
||||||
$this->points = $row['total'];
|
$this->points = $row['total'];
|
||||||
|
|
||||||
|
if($this->points < 100) return;
|
||||||
|
|
||||||
|
$this->points = 100;
|
||||||
|
|
||||||
|
$query = "SELECT COUNT(`points`) AS `total` FROM `notary` " .
|
||||||
|
"WHERE `from` = :user AND `method` == 'Face to Face Meeting' AND `from` != `to`";
|
||||||
|
$query_params['user'] = $this->id;
|
||||||
|
$row = $this->db->query($query, $query_params)->fetch();
|
||||||
|
if ($row['total'] === null) $row['total'] = 0;
|
||||||
|
|
||||||
|
$this->points += ($row['total'] > 25) ? 50 : $row['total'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue