1
This commit is contained in:
parent
ed2b272dc5
commit
0b55409cc6
@ -212,9 +212,9 @@ class Staking extends BaseModel {
|
|||||||
myself()->_getDaySeconds($row['start_time'])) /
|
myself()->_getDaySeconds($row['start_time'])) /
|
||||||
3600 / 24);
|
3600 / 24);
|
||||||
$saveDays = intval($row['stake_time'] / 3600 / 24);
|
$saveDays = intval($row['stake_time'] / 3600 / 24);
|
||||||
$dailyInterest = self::getDailyInterest($row['stake_time']);
|
|
||||||
$dto['stacked_days'] = max(0, $passedDays);
|
$dto['stacked_days'] = max(0, $passedDays);
|
||||||
$dto['remain_days'] = max(0, $saveDays - $dto['stacked_days']);
|
$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;
|
$dto['daily_rewards'] = $dto['cec_value'] * $dailyInterest;
|
||||||
/*
|
/*
|
||||||
error_log(json_encode(array(
|
error_log(json_encode(array(
|
||||||
@ -246,7 +246,7 @@ class Staking extends BaseModel {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function getDailyInterest($stakeTime)
|
private static function getDailyInterest($stakeTime, $remainDays)
|
||||||
{
|
{
|
||||||
$months = intval($stakeTime / 3600 / 24 / 30);
|
$months = intval($stakeTime / 3600 / 24 / 30);
|
||||||
if ($months <= 0) {
|
if ($months <= 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user