revert changes for mysql ifnull functions

This commit is contained in:
r4sas 2018-05-12 13:25:13 +00:00
parent b183ff19bd
commit ce78e8b59d

View File

@ -575,9 +575,9 @@ class Statistics extends Base {
if ($this->getGetCache() && $data = $this->memcache->get(__FUNCTION__ . $account_id)) return $data;
$stmt = $this->mysqli->prepare("
SELECT
IFNULL(SUM(difficulty) / ?, " . $this->coin->getShareDifficultyPrecision() . ") AS sharerate,
IFNULL(SUM(difficulty), " . $this->coin->getShareDifficultyPrecision() . ") AS shares,
IFNULL(AVG(difficulty), " . $this->coin->getShareDifficultyPrecision() . ") AS avgsharediff
IFNULL(SUM(difficulty) / ?, 0) AS sharerate,
IFNULL(SUM(difficulty), 0) AS shares,
IFNULL(AVG(difficulty), 0) AS avgsharediff
FROM (
SELECT
id, our_result, IF(difficulty = 0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty) AS difficulty