mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 09:27:25 +00:00
api: fix foreach typo in commit d78a329
and show timestamps as int value
This commit is contained in:
parent
d78a932939
commit
c234694699
2 changed files with 8 additions and 8 deletions
|
@ -287,22 +287,22 @@ class ApiController extends CommonController
|
|||
|
||||
if(YAAMP_API_PAYOUTS)
|
||||
{
|
||||
$json_payouts = controller()->memcache->get("api_payouts-$user->id");
|
||||
$json_payouts = controller()->memcache->get("api_payouts-".$user->id);
|
||||
if (empty($json_payouts)) {
|
||||
$json_payouts = ",\"payouts\": ";
|
||||
$json_payouts .= "[";
|
||||
$list = getdbolist('db_payouts', "account_id={$user->id} AND completed>0 AND tx IS NOT NULL AND time >= ".(time() - YAAMP_API_PAYOUTS_PERIOD)." ORDER BY time DESC");
|
||||
foreach($list as $j => payout)
|
||||
foreach($list as $j => $payout)
|
||||
{
|
||||
if($j) $json_payouts .= ", ";
|
||||
$json_payouts .= "{";
|
||||
$json_payouts .= "\"time\": \"$payout->time\",";
|
||||
$json_payouts .= "\"amount\": \"$payout->amount\",";
|
||||
$json_payouts .= "\"tx\": \"$payout->tx\"";
|
||||
$json_payouts .= "\"time\": ".(0 + $payout->time).",";
|
||||
$json_payouts .= "\"amount\": \"{$payout->amount}\",";
|
||||
$json_payouts .= "\"tx\": \"{$payout->tx}\"";
|
||||
$json_payouts .= "}";
|
||||
}
|
||||
$json_payouts .= "]";
|
||||
controller()->memcache->set("api_payouts-$user->id", $json_payouts, 60, MEMCACHE_COMPRESSED);
|
||||
controller()->memcache->set("api_payouts-".$user->id, $json_payouts, 60, MEMCACHE_COMPRESSED);
|
||||
}
|
||||
echo str_replace("},","},\n", $json_payouts);
|
||||
}
|
||||
|
|
|
@ -46,8 +46,8 @@ result:
|
|||
"rejected": 0
|
||||
}]
|
||||
<?php if (YAAMP_API_PAYOUTS) : ?>
|
||||
"payouts":[{
|
||||
"time": "1529860641",
|
||||
,"payouts":[{
|
||||
"time": 1529860641,
|
||||
"amount": "0.001",
|
||||
"tx": "transaction_id_of_the_payout"
|
||||
}]
|
||||
|
|
Loading…
Add table
Reference in a new issue