[FIX] getUserShareDifficulty must return 0 on NULL
This commit is contained in:
parent
6fd04fc838
commit
a545362ba5
@ -398,7 +398,7 @@ class Statistics {
|
||||
if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
|
||||
$stmt = $this->mysqli->prepare("
|
||||
SELECT
|
||||
AVG(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) AS avgsharediff,
|
||||
IFNULL(AVG(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)), 0) AS avgsharediff,
|
||||
COUNT(s.id) AS total
|
||||
FROM " . $this->share->getTableName() . " AS s JOIN " . $this->user->getTableName() . " AS a
|
||||
ON a.username = SUBSTRING_INDEX( s.username, '.', 1 )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user