@@ 172-184 (lines=13) @@ | ||
169 | ) AS shares |
|
170 | FROM $this->table AS w |
|
171 | WHERE account_id = ?"); |
|
172 | if ($this->checkStmt($stmt) && $stmt->bind_param('iiiii', $interval, $interval, $interval, $interval, $account_id) && $stmt->execute() && $result = $stmt->get_result()) { |
|
173 | $aData = array(); |
|
174 | while ($row = $result->fetch_assoc()) { |
|
175 | $row['hashrate'] = round($this->coin->calcHashrate($row['shares'], $interval), 2); |
|
176 | if ($row['count_all'] > 0) { |
|
177 | $row['difficulty'] = round($row['shares'] / $row['count_all'], $this->coin->getShareDifficultyPrecision()); |
|
178 | } else { |
|
179 | $row['difficulty'] = 0.00; |
|
180 | } |
|
181 | $aData[] = $row; |
|
182 | } |
|
183 | return $aData; |
|
184 | } |
|
185 | return $this->sqlError('E0056'); |
|
186 | } |
|
187 | ||
@@ 222-234 (lines=13) @@ | ||
219 | ) AS shares |
|
220 | FROM $this->table AS w |
|
221 | ORDER BY shares DESC LIMIT ?,?"); |
|
222 | if ($this->checkStmt($stmt) && $stmt->bind_param('iiiiii', $interval, $interval, $interval, $interval, $start, $iLimit) && $stmt->execute() && $result = $stmt->get_result()) { |
|
223 | $aData = array(); |
|
224 | while ($row = $result->fetch_assoc()) { |
|
225 | $row['hashrate'] = round($this->coin->calcHashrate($row['shares'], $interval), 2); |
|
226 | if ($row['count_all'] > 0) { |
|
227 | $row['avg_difficulty'] = round($row['shares'] / $row['count_all'], 2); |
|
228 | } else { |
|
229 | $row['avg_difficulty'] = 0.00; |
|
230 | } |
|
231 | $aData[] = $row; |
|
232 | } |
|
233 | return $aData; |
|
234 | } |
|
235 | return $this->sqlError('E0057'); |
|
236 | } |
|
237 |