This commit is contained in:
aozhiwei 2023-08-29 12:15:30 +08:00
parent 90ea3998cf
commit a2bc845824

View File

@ -225,6 +225,12 @@ class Staking extends BaseModel {
$dto['cec_rewards'] = 0; $dto['cec_rewards'] = 0;
$dto['total_rewards'] = 0; $dto['total_rewards'] = 0;
if ($dto['status'] == self::REDEEM_STATUS) { if ($dto['status'] == self::REDEEM_STATUS) {
if ($dto['remain_days'] <= 0 ) {
$dto['cec_rewards'] = $dto['daily_rewards'] * $saveDays;
} else {
$dto['cec_rewards'] = $dto['daily_rewards'] * ($saveDays - $dto['remain_days']) * 0.25;
}
$dto['total_rewards'] = $dto['cec_rewards'];
} else { } 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;