Chainquery integration #49

Merged
marcdeb1 merged 44 commits from chainquery into master 2019-02-13 19:01:13 +01:00
3 changed files with 6 additions and 5 deletions
Showing only changes of commit fbfd5b8f39 - Show all commits

View file

@ -597,7 +597,6 @@ class MainController extends AppController {
$resultSet = [];
$conn = ConnectionManager::get('default');
// get avg block sizes for the time period
$stmt = $conn->execute("SELECT AVG(block_size) AS AvgBlockSize, DATE_FORMAT(FROM_UNIXTIME(block_time), '$sqlDateFormat') AS TimePeriod " .
"FROM block WHERE DATE_FORMAT(FROM_UNIXTIME(block_time), '$sqlDateFormat') >= ? GROUP BY TimePeriod ORDER BY TimePeriod ASC", [$start->format($dateFormat)]);
@ -611,8 +610,8 @@ class MainController extends AppController {
// get avg prices
$conn = ConnectionManager::get('localdb');
$stmt = $conn->execute("SELECT AVG(USD) AS AvgUSD, DATE_FORMAT(Created, '$sqlDateFormat') AS TimePeriod " .
$conn_local = ConnectionManager::get('localdb');
$stmt = $conn_local->execute("SELECT AVG(USD) AS AvgUSD, DATE_FORMAT(Created, '$sqlDateFormat') AS TimePeriod " .
"FROM PriceHistory WHERE DATE_FORMAT(Created, '$sqlDateFormat') >= ? GROUP BY TimePeriod ORDER BY TimePeriod ASC", [$start->format($dateFormat)]);
$avgPrices = $stmt->fetchAll(\PDO::FETCH_OBJ);
foreach ($avgPrices as $price) {

View file

@ -127,7 +127,7 @@ class AuxShell extends Shell {
public function pricehistory() {
self::lock('pricehistory');
$conn = ConnectionManager::get('default');
$conn = ConnectionManager::get('localdb');
$redis = new \Predis\Client(Configure::read('Redis.Url'));
try {

View file

@ -76,9 +76,11 @@
<div class="label">NameClaimRoot</div> <div class="value"><?php echo $block->name_claim_root ?></div>
<!--
<div class="spacer"></div>
<div class="label">Target</div> <div class="value"><?php echo '$block->Target' ?></div>
<div class="label">Target</div> <div class="value"><?php echo $block->Target ?></div>
-->
<div class="spacer"></div>