This commit is contained in:
hujiabin 2023-09-11 14:53:55 +08:00
parent dcfe22241f
commit 5bd14c4822

View File

@ -37,8 +37,13 @@ class ComputingPowerController extends BaseAuthedController
"cec" => 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();
$nextMeta = \mt\HashRateCommon::getNextPeriod();
if (!$currentMeta && $lastMeta){
@ -80,12 +85,22 @@ class ComputingPowerController extends BaseAuthedController
$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(
'period_state' => $period_state,
'curr_period' => $curr_period,
'curr_reward' => $reward,
'last_period' => $last_period,
'listing_state' => LISTING_SWITCH,
'owned_cec' => RewardsCec::getTotalCecNum(),
'owned_total_hash_rate' =>ComputingPower::getMyTotalBH(),