From 5722c46f54c5d52ca05e2e7a349d606c060c8992 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 26 Aug 2023 10:58:29 +0800 Subject: [PATCH] 1 --- webapp/controller/StakingController.class.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/webapp/controller/StakingController.class.php b/webapp/controller/StakingController.class.php index 6bf967a7..e9779190 100644 --- a/webapp/controller/StakingController.class.php +++ b/webapp/controller/StakingController.class.php @@ -31,30 +31,30 @@ class StackingController extends BaseAuthedController { ), ); $rows = Stacking::all(myself()->_getAddress()); - $this->fillStackingInfo($info['planet'], $rows); - $this->fillStackingInfo($info['badge'], $rows); - $this->fillStackingInfo($info['cec'], $rows); + $this->fillStackingInfo($info, 'planet', $rows); + $this->fillStackingInfo($info, 'badge', $rows); + $this->fillStackingInfo($info, 'cec', $rows); myself()->_rspData($info); } private function fillStackingInfo(&$info, $rows) { - $info['staked_quant'] = 0; - $info['claim_rewards'] = 0; - $info['daily_rewards'] = 0; - $info['staking_value'] = 0; - $info['maturity_quant'] = 0; + $stackingInfo['staked_quant'] = 0; + $stackingInfo['claim_rewards'] = 0; + $stackingInfo['daily_rewards'] = 0; + $stackingInfo['staking_value'] = 0; + $stackingInfo['maturity_quant'] = 0; foreach ($rows as $row) { - if ($this->isTypeNft($info['type'], $row) && + if ($this->isTypeNft($stackingInfo['type'], $row) && $row['status'] == Stacking::STAKING_STATUS) { if ($row['start_time'] + $row['stake_time'] < myself()->_getNowTime()) { - $info['staked_quant'] += $row['stacked_num']; + $stackingInfo['staked_quant'] += $row['stacked_num']; } else { - $info['maturity_quant'] += $row['stacked_num']; + $stackingInfo['maturity_quant'] += $row['stacked_num']; } $stakingMeta = mt\Staking::get($row['item_id']); if ($stakingMeta) { - $info['staking_value'] += $stakingMeta['stake_value']; + $stackingInfo['staking_value'] += $stakingMeta['stake_value']; } } }