Skip to content

Commit

Permalink
Update golos/stakebot/jackpot: add 0 for show amount
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-skripnik committed Jan 1, 2021
1 parent 74489e8 commit 422d2d3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions blockchains/golos/apps/stakebot/pages/jackpot/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@
global $conf;
$html = file_get_contents('http://138.201.91.11:3000/golos-api?service=stakebot&type=jackpot');
$result = json_decode($html, true);
$amount = $result['amount'];
$table = $result['data'];
$amount = 0;
if (isset($result['amount'])) {
$amount = $result['amount'];
}
$content = '<p align="center"><a href="'.$conf['siteUrl'].'golos/stakebot">К списку текущих ставок</a></p>
<p>Список очищается после получения джекпота победителями. Это происходит в полночь по GMT (3 часа по Москве) 1 числа каждого месяца.</p>
<p>Фонд формируется за счёт 5% от сумм ставок участников.</p>
<p>Вся <a href="'.$conf['siteUrl'].'golos/profiles/golos-stake-bot/donates" target="_blank">история донатов golos_stake_bot</a>.</p>
<h2>Сумма джекпота: '.$amount.' GOLOS</h2>
<table id="table"><thead><tr><th>№</th><th>Логин</th><th>Сумма</th></tr></thead><tbody id="target">';
if ($table) {
foreach ($table as $key => $value) {
if (isset($result['data'])) {
$table = $result['data'];
foreach ($table as $key => $value) {
$n = $key + 1;
$content .= '<tr align="right"><td>'.$n.'</td>
<td><a href="'.$conf['siteUrl'].'golos/profiles/'.$value['user'].'" target="_blank">'.$value['user'].'</a></td>
Expand Down

0 comments on commit 422d2d3

Please sign in to comment.