From 0b55409cc6cc1c2f1cfbab230cb7138a1a1a25c9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 29 Aug 2023 16:29:20 +0800 Subject: [PATCH] 1 --- webapp/models/Staking.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/models/Staking.php b/webapp/models/Staking.php index 4a5350c4..d044b106 100644 --- a/webapp/models/Staking.php +++ b/webapp/models/Staking.php @@ -212,9 +212,9 @@ class Staking extends BaseModel { myself()->_getDaySeconds($row['start_time'])) / 3600 / 24); $saveDays = intval($row['stake_time'] / 3600 / 24); - $dailyInterest = self::getDailyInterest($row['stake_time']); $dto['stacked_days'] = max(0, $passedDays); $dto['remain_days'] = max(0, $saveDays - $dto['stacked_days']); + $dailyInterest = self::getDailyInterest($row['stake_time'], $dto['remain_days']); $dto['daily_rewards'] = $dto['cec_value'] * $dailyInterest; /* error_log(json_encode(array( @@ -246,7 +246,7 @@ class Staking extends BaseModel { return 1; } - private static function getDailyInterest($stakeTime) + private static function getDailyInterest($stakeTime, $remainDays) { $months = intval($stakeTime / 3600 / 24 / 30); if ($months <= 0) {