1
This commit is contained in:
parent
dcfe22241f
commit
5bd14c4822
@ -37,8 +37,13 @@ class ComputingPowerController extends BaseAuthedController
|
|||||||
"cec" => 0,
|
"cec" => 0,
|
||||||
"point" => 0,
|
"point" => 0,
|
||||||
);
|
);
|
||||||
|
$last_period = array(
|
||||||
|
"period_begin" => 0,
|
||||||
|
"period_end" => 0,
|
||||||
|
"reward" => 0,
|
||||||
|
);
|
||||||
|
|
||||||
$lastMeta = \mt\HashRateCommon::getLastPeriod();
|
$lastMeta = \mt\HashRateCommon::getLastPeriod();
|
||||||
$currentMeta = \mt\HashRateCommon::getCurrentPeriod();
|
$currentMeta = \mt\HashRateCommon::getCurrentPeriod();
|
||||||
$nextMeta = \mt\HashRateCommon::getNextPeriod();
|
$nextMeta = \mt\HashRateCommon::getNextPeriod();
|
||||||
if (!$currentMeta && $lastMeta){
|
if (!$currentMeta && $lastMeta){
|
||||||
@ -80,12 +85,22 @@ class ComputingPowerController extends BaseAuthedController
|
|||||||
$reward['point'] = $ownerNum;
|
$reward['point'] = $ownerNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($lastMeta){
|
||||||
|
$last_period['period_begin'] = strtotime($lastMeta['start_time']);
|
||||||
|
$last_period['period_end'] = strtotime($lastMeta['end_time']);
|
||||||
|
$cecDb = RewardsCec::findByAccount(myself()->_getAccountId(),$lastMeta['id']);
|
||||||
|
$last_period['reward'] = $cecDb ? $cecDb['reward_cec'] : 0;
|
||||||
|
$last_period['last_hash_rate'] = ComputingPower::getOwnedBH($lastMeta['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$info = array(
|
$info = array(
|
||||||
'period_state' => $period_state,
|
'period_state' => $period_state,
|
||||||
'curr_period' => $curr_period,
|
'curr_period' => $curr_period,
|
||||||
'curr_reward' => $reward,
|
'curr_reward' => $reward,
|
||||||
|
'last_period' => $last_period,
|
||||||
'listing_state' => LISTING_SWITCH,
|
'listing_state' => LISTING_SWITCH,
|
||||||
'owned_cec' => RewardsCec::getTotalCecNum(),
|
'owned_cec' => RewardsCec::getTotalCecNum(),
|
||||||
'owned_total_hash_rate' =>ComputingPower::getMyTotalBH(),
|
'owned_total_hash_rate' =>ComputingPower::getMyTotalBH(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user