From f613cc6bfdde275cfbc039af071daf26e2d711a0 Mon Sep 17 00:00:00 2001 From: Neozonz Date: Tue, 21 Jan 2014 20:06:37 -0500 Subject: [PATCH] [FIX] Set interval for sample size as well --- public/include/classes/worker.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/include/classes/worker.class.php b/public/include/classes/worker.class.php index ea5d68a1..9076cc3c 100644 --- a/public/include/classes/worker.class.php +++ b/public/include/classes/worker.class.php @@ -72,8 +72,8 @@ class Worker extends Base { $this->debug->append("STA " . __METHOD__, 4); $stmt = $this->mysqli->prepare(" SELECT id, username, password, monitor, - ( SELECT COUNT(id) FROM " . $this->share->getTableName() . " WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)) AS count_all, - ( SELECT COUNT(id) FROM " . $this->share->getArchiveTableName() . " WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL 10 MINUTE)) AS count_all_archive, + ( SELECT COUNT(id) FROM " . $this->share->getTableName() . " WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL ? SECOND)) AS count_all, + ( SELECT COUNT(id) FROM " . $this->share->getArchiveTableName() . " WHERE username = w.username AND time > DATE_SUB(now(), INTERVAL ? SECOND)) AS count_all_archive, ( SELECT IFNULL(IF(our_result='Y', ROUND(SUM(IF(difficulty=0, pow(2, (" . $this->config['difficulty'] . " - 16)), difficulty)) * POW(2, " . $this->config['target_bits'] . ") / ? / 1000), 0), 0) AS hashrate @@ -101,7 +101,7 @@ class Worker extends Base { FROM $this->table AS w WHERE id = ? "); - if ($this->checkStmt($stmt) && $stmt->bind_param('iiiiiii', $interval, $interval, $interval, $interval, $interval, $interval, $id) && $stmt->execute() && $result = $stmt->get_result()) + if ($this->checkStmt($stmt) && $stmt->bind_param('iiiiiiiii',$interval, $interval, $interval, $interval, $interval, $interval, $interval, $interval, $id) && $stmt->execute() && $result = $stmt->get_result()) return $result->fetch_assoc(); return $this->sqlError('E0055'); }