This commit is contained in:
aozhiwei 2023-08-29 16:29:20 +08:00
parent ed2b272dc5
commit 0b55409cc6

View File

@ -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) {