From 7eac65b4eddbdd2f6f65888c1c06b4f5b73ed395 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 30 Aug 2023 14:48:00 +0800 Subject: [PATCH] 1 --- webapp/controller/BaseAuthedController.class.php | 3 ++- webapp/controller/StakingController.class.php | 2 +- webapp/models/Staking.php | 10 +++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 9253700a..ffbd6efe 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -182,7 +182,8 @@ class BaseAuthedController extends BaseController { if (SERVER_ENV != _ONLINE && empty($this->address)) { $this->address = strtolower('0xa9ecB9F3A0b54d31ce4a035C89EC7Da4110beB59'); if (myself()->_getAccountId() == '6513_2006_3WOWIsmpcihK1KTnNP1Ky5MBOh7rt6Rl') { - $this->address = strtolower('0x0bb52209756e8d157f2e551a9adb8d9019b688b1'); + ///$this->address = strtolower('0x0bb52209756e8d157f2e551a9adb8d9019b688b1'); + $this->address = strtolower('0xbd2d6de4b70d370954b187c95dddfbd00f4129ff'); } } } diff --git a/webapp/controller/StakingController.class.php b/webapp/controller/StakingController.class.php index 1bbb9c55..50104ef2 100644 --- a/webapp/controller/StakingController.class.php +++ b/webapp/controller/StakingController.class.php @@ -18,7 +18,7 @@ class StakingController extends BaseAuthedController { { parent::_handlePre(); if (SERVER_ENV != _ONLINE) { - myself()->_setTimeOffset(3600 * 24 * 2); + myself()->_setTimeOffset(3600 * 24 * 31); } } diff --git a/webapp/models/Staking.php b/webapp/models/Staking.php index 74ad51f6..1ab0747f 100644 --- a/webapp/models/Staking.php +++ b/webapp/models/Staking.php @@ -239,12 +239,16 @@ class Staking extends BaseModel { 'redeem_time' => myself()->_getDaySeconds($dto['redeem_time']) ))); }*/ + $rate = 0.25; + if ($stakedDays >= $saveDays) { + $rate = 1; + } if ($saveDays >= 30 * 12 * 2) { $stakedDays = max($stakedDays, 0); - $dto['cec_rewards'] = ($dto['cec_value'] * (0.6 / 30 / 12)) * min(30 * 12, $stakedDays) * 0.25; - $dto['cec_rewards'] += ($dto['cec_value'] * (0.4 / 30 / 12)) * max(0, $stakedDays - 30 * 12) * 0.25; + $dto['cec_rewards'] = ($dto['cec_value'] * (0.6 / 30 / 12)) * min(30 * 12, $stakedDays) * $rate; + $dto['cec_rewards'] += ($dto['cec_value'] * (0.4 / 30 / 12)) * max(0, $stakedDays - 30 * 12) * $rate; } else { - $dto['cec_rewards'] = $dto['daily_rewards'] * $stakedDays * 0.25; + $dto['cec_rewards'] = $dto['daily_rewards'] * $stakedDays * $rate; } $dto['total_rewards'] = $dto['cec_rewards']; } else {