Price history db name

This commit is contained in:
marcdeb1 2018-12-18 20:17:34 +01:00
parent edbc11db7f
commit fbfd5b8f39
3 changed files with 6 additions and 5 deletions

View file

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

View file

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

View file

@ -76,9 +76,11 @@
<div class="label">NameClaimRoot</div> <div class="value"><?php echo $block->name_claim_root ?></div> <div class="label">NameClaimRoot</div> <div class="value"><?php echo $block->name_claim_root ?></div>
<!--
<div class="spacer"></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> <div class="spacer"></div>