Re-add shares archive table for 24h hashrates
This should fix #312 and fix #256 where hashrates are reset on quick rounds. Users are not able to properly view their past 24h hashrates. Will be merged once confirmed working.
This commit is contained in:
parent
346d9656d8
commit
ab85af19a1
@ -374,6 +374,16 @@ class Statistics {
|
|||||||
ROUND(COUNT(s.id) * POW(2, " . $this->config['difficulty'] . ") / 3600 / 1000) AS hashrate,
|
ROUND(COUNT(s.id) * POW(2, " . $this->config['difficulty'] . ") / 3600 / 1000) AS hashrate,
|
||||||
HOUR(s.time) AS hour
|
HOUR(s.time) AS hour
|
||||||
FROM " . $this->share->getTableName() . " AS s, accounts AS a
|
FROM " . $this->share->getTableName() . " AS s, accounts AS a
|
||||||
|
WHERE time < NOW() - INTERVAL 1 HOUR
|
||||||
|
AND time > NOW() - INTERVAL 25 HOUR
|
||||||
|
AND a.username = SUBSTRING_INDEX( s.username, '.', 1 )
|
||||||
|
AND a.id = ?
|
||||||
|
GROUP BY HOUR(time)
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
ROUND(COUNT(s.id) * POW(2, " . $this->config['difficulty'] . ") / 3600 / 1000) AS hashrate,
|
||||||
|
HOUR(s.time) AS hour
|
||||||
|
FROM " . $this->share->getArchiveTableName() . " AS s, accounts AS a
|
||||||
WHERE time < NOW() - INTERVAL 1 HOUR
|
WHERE time < NOW() - INTERVAL 1 HOUR
|
||||||
AND time > NOW() - INTERVAL 25 HOUR
|
AND time > NOW() - INTERVAL 25 HOUR
|
||||||
AND a.username = SUBSTRING_INDEX( s.username, '.', 1 )
|
AND a.username = SUBSTRING_INDEX( s.username, '.', 1 )
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user