diff --git a/webapp/controller/StakingController.class.php b/webapp/controller/StakingController.class.php index 553e8630..dcb29348 100644 --- a/webapp/controller/StakingController.class.php +++ b/webapp/controller/StakingController.class.php @@ -60,10 +60,10 @@ class StakingController extends BaseAuthedController { } $stackingInfo['staked_quant'] += $stakingDto['stacked_num']; $stackingInfo['staking_value'] += $stakingDto['cec_value']; + $info['total_staking_value'] += $stakingDto['cec_value'] + $stackingInfo['daily_rewards']; } else { $stackingInfo['claim_rewards'] += $stakingDto['total_rewards']; } - $info['total_staking_value'] += $stakingDto['cec_value'] + $stackingInfo['daily_rewards']; } } } diff --git a/webapp/models/Staking.php b/webapp/models/Staking.php index 6808791e..c5e2e109 100644 --- a/webapp/models/Staking.php +++ b/webapp/models/Staking.php @@ -241,6 +241,7 @@ class Staking extends BaseModel { } else { if ($saveDays >= 30 * 12 * 2) { $stakedDays = intval(($dto['redeem_time'] - myself()->_getNowTime()) / 3600 / 24); + $stakedDays = max($stakedDays, 0); $dto['cec_rewards'] = $srcDailyRewards * min(30 * 12, $stakedDays) * 0.6 * 0.25; $dto['cec_rewards'] += $srcDailyRewards * max(0, $stakedDays - 30 * 12) * 0.4 * 0.25; } else {