From 905898700ae3bb5447ec3b8c9c0862316b6b48b2 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 17 Jun 2013 16:35:27 +0200 Subject: [PATCH] adding per-user share statistics to cron --- cronjobs/statistics.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cronjobs/statistics.php b/cronjobs/statistics.php index 03aad394..d4fe65e0 100755 --- a/cronjobs/statistics.php +++ b/cronjobs/statistics.php @@ -38,4 +38,12 @@ if (!$statistics->getCurrentHashrate()) if (!$statistics->getAllUserStats('%')) verbose("Unable to fetch and store admin panel full user list\n"); +// Per user share statistics based on all shares submitted +$stmt = $mysqli->prepare("SELECT DISTINCT SUBSTRING_INDEX( `username` , '.', 1 ) AS username FROM " . $share->getTableName()); +if ($stmt && $stmt->execute() && $result = $stmt->get_result()) { + while ($row = $result->fetch_assoc()) { + if (!$statistics->getUserShares($user->getUserId($row['username']))) + verbose("Failed to fetch and store user stats for " . $row['username'] . "\n"); + } +} ?>