[FIX] SQL again, sigh

This commit is contained in:
Sebastian Grewe 2014-01-19 17:28:34 +01:00
parent 8a983835c6
commit 5b7cf6ab93

View File

@ -464,14 +464,14 @@ class Statistics extends Base {
FROM (
SELECT
id,
IF(s.difficulty = 0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty) AS difficulty,
IF(difficulty = 0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty) AS difficulty,
username
FROM shares
WHERE time > DATE_SUB(now(), INTERVAL ? SECOND) AND our_result = 'Y'
UNION
SELECT
share_id,
IF(s.difficulty = 0, POW(2, (" . $this->config['difficulty'] . " - 16)), s.difficulty) AS difficulty,
IF(difficulty = 0, POW(2, (" . $this->config['difficulty'] . " - 16)), difficulty) AS difficulty,
username
FROM shares_archive
WHERE time > DATE_SUB(now(), INTERVAL ? SECOND) AND our_result = 'Y'