This commit is contained in:
aozhiwei 2023-08-29 12:12:20 +08:00
parent e2c9db5c2d
commit 90ea3998cf

View File

@ -220,13 +220,17 @@ class Staking extends BaseModel {
'remain_days' => max(0, $saveDays - $dto['stacked_days']), 'remain_days' => max(0, $saveDays - $dto['stacked_days']),
'daily_rewards' => $dto['daily_rewards'], 'daily_rewards' => $dto['daily_rewards'],
'daily_interest' => $dailyInterest 'daily_interest' => $dailyInterest
)));*/ )));
*/
$dto['cec_rewards'] = 0;
$dto['total_rewards'] = 0;
if ($dto['status'] == self::REDEEM_STATUS) {
} else {
if ($dto['remain_days'] <= 0 ) { if ($dto['remain_days'] <= 0 ) {
$dto['cec_rewards'] = $dto['daily_rewards'] * $saveDays; $dto['cec_rewards'] = $dto['daily_rewards'] * $saveDays;
} else {
$dto['cec_rewards'] = 0;
} }
$dto['total_rewards'] = $dto['daily_rewards'] * ($saveDays - $dto['remain_days']); $dto['total_rewards'] = $dto['daily_rewards'] * ($saveDays - $dto['remain_days']);
}
return $dto; return $dto;
} }