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 @@ - - - - {if $GLOBAL.config.disable_notifications != 1}{/if} - - - + + + + {if $GLOBAL.config.disable_notifications != 1}{/if} + + + {nocache} {section worker $WORKERS} @@ -29,6 +29,7 @@ {/if} + {/section} diff --git a/public/templates/mobile/account/workers/default.tpl b/public/templates/mobile/account/workers/default.tpl index 09ebf867..996c6467 100644 --- a/public/templates/mobile/account/workers/default.tpl +++ b/public/templates/mobile/account/workers/default.tpl @@ -4,6 +4,7 @@ + {section worker $WORKERS} {assign var="username" value="."|escape|explode:$WORKERS[worker].username:2} @@ -11,6 +12,7 @@ + {/section}
Worker NamePasswordActiveMonitorKhash/s  Worker NamePasswordActiveMonitorKhash/sDifficultyAction
{$WORKERS[worker].hashrate|number_format}{$WORKERS[worker].difficulty|number_format:"2"}
Worker Name Active Khash/sDifficulty
{$username.0|escape}.{$username.1|escape} {$WORKERS[worker].hashrate|number_format}{$WORKERS[worker].hashrate|number_format}