1
This commit is contained in:
parent
00c6c95eef
commit
162210ea2e
@ -55,10 +55,8 @@ class StakingController extends BaseAuthedController {
|
|||||||
if ($stakingDto['remain_days'] <= 0) {
|
if ($stakingDto['remain_days'] <= 0) {
|
||||||
$stackingInfo['maturity_quant'] += $stakingDto['stacked_num'];
|
$stackingInfo['maturity_quant'] += $stakingDto['stacked_num'];
|
||||||
} else {
|
} else {
|
||||||
$stackingInfo['daily_rewards'] += $stakingDto['cec_value'] *
|
$stackingInfo['daily_rewards'] += $stakingDto['daily_rewards'];
|
||||||
$stakingDto['daily_rewards'];
|
$info['daily_staking_value'] += $stakingDto['daily_rewards'];
|
||||||
$info['daily_staking_value'] += $stakingDto['cec_value'] *
|
|
||||||
$stakingDto['daily_rewards'];
|
|
||||||
}
|
}
|
||||||
$stackingInfo['staked_quant'] += $stakingDto['stacked_num'];
|
$stackingInfo['staked_quant'] += $stakingDto['stacked_num'];
|
||||||
$stackingInfo['staking_value'] += $stakingDto['cec_value'];
|
$stackingInfo['staking_value'] += $stakingDto['cec_value'];
|
||||||
|
@ -215,6 +215,12 @@ class Staking extends BaseModel {
|
|||||||
$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']);
|
||||||
$dto['daily_rewards'] = $dto['cec_value'] * $dailyInterest;
|
$dto['daily_rewards'] = $dto['cec_value'] * $dailyInterest;
|
||||||
|
/*
|
||||||
|
error_log(json_encode(array(
|
||||||
|
'remain_days' => max(0, $saveDays - $dto['stacked_days']),
|
||||||
|
'daily_rewards' => $dto['daily_rewards'],
|
||||||
|
'daily_interest' => $dailyInterest
|
||||||
|
)));*/
|
||||||
if ($dto['remain_days'] <= 0 ) {
|
if ($dto['remain_days'] <= 0 ) {
|
||||||
$dto['cec_rewards'] = $dto['daily_rewards'] * $saveDays;
|
$dto['cec_rewards'] = $dto['daily_rewards'] * $saveDays;
|
||||||
$dto['total_rewards'] = $dto['daily_rewards'] * $saveDays;
|
$dto['total_rewards'] = $dto['daily_rewards'] * $saveDays;
|
||||||
@ -238,15 +244,15 @@ class Staking extends BaseModel {
|
|||||||
}
|
}
|
||||||
//1 3 6 12 24
|
//1 3 6 12 24
|
||||||
if ($months <= 1) {
|
if ($months <= 1) {
|
||||||
return 0.01 / 30 * $months;
|
return 0.01 / 30 / $months;
|
||||||
} else if ($months <= 3) {
|
} else if ($months <= 3) {
|
||||||
return 0.05 / 30 * $months;
|
return 0.05 / 30 / $months;
|
||||||
} else if ($months <= 6) {
|
} else if ($months <= 6) {
|
||||||
return 0.15 / 30 * $months;
|
return 0.15 / 30 / $months;
|
||||||
} else if ($months <= 12) {
|
} else if ($months <= 12) {
|
||||||
return 0.4 / 30 * $months;
|
return 0.4 / 30 / $months;
|
||||||
} else if ($months <= 24) {
|
} else if ($months <= 24) {
|
||||||
return 1 / 30 * $months;
|
return 1 / 30 / $months;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user