diff --git a/public/include/classes/worker.class.php b/public/include/classes/worker.class.php index 1388b730..d9b87945 100644 --- a/public/include/classes/worker.class.php +++ b/public/include/classes/worker.class.php @@ -136,14 +136,23 @@ class Worker { WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE) - ) + ( - SELECT + ) + ( + SELECT IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * 65536/600/1000), 0), 0) AS hashrate FROM " . $this->share->getArchiveTableName() . " WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE) - ) AS hashrate + ) AS hashrate, + ( + SELECT IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) / COUNT(id), 2), 0), 0) + FROM " . $this->share->getTableName() . " + WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE) + ) + ( + SELECT IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) / COUNT(id), 2), 0), 0) + FROM " . $this->share->getArchiveTableName() . " + WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE) + ) AS difficulty FROM $this->table AS w WHERE account_id = ?"); if ($this->checkStmt($stmt) && $stmt->bind_param('i', $account_id) && $stmt->execute() && $result = $stmt->get_result()) diff --git a/public/templates/mmcFE/account/workers/default.tpl b/public/templates/mmcFE/account/workers/default.tpl index 65635b4b..2f35e617 100644 --- a/public/templates/mmcFE/account/workers/default.tpl +++ b/public/templates/mmcFE/account/workers/default.tpl @@ -7,13 +7,13 @@