From 972381ba078e315a4351c5a8fa1094bcf4a70e91 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 28 Aug 2023 11:57:16 +0800 Subject: [PATCH 1/2] 1 --- webapp/models/Staking.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/webapp/models/Staking.php b/webapp/models/Staking.php index 0a420cb7..968af367 100644 --- a/webapp/models/Staking.php +++ b/webapp/models/Staking.php @@ -41,6 +41,21 @@ class Staking extends BaseModel { return $result; } + public static function getStakingTotalValue() + { + $totalValue = 0; + $rows = self::all(myself()->_getAddress()); + foreach ($rows as $row) { + $stakingDto = self::toDto($row); + if ($stakingDto['status'] == Stacking::STAKING_STATUS) { + if ($stakingDto['remain_days'] <= 0) { + $totalValue += $stakingDto['ceg_value']; + } + } + } + return $totalValue; + } + public static function staked721($data, $netId) { foreach ($data['infos'] as $info) { From 4b75908024ed613532b2e5c1bb8a8f4a2cb75662 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 28 Aug 2023 12:00:04 +0800 Subject: [PATCH 2/2] 1 --- webapp/controller/StakingController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/controller/StakingController.class.php b/webapp/controller/StakingController.class.php index 3c5bf8ca..696f454d 100644 --- a/webapp/controller/StakingController.class.php +++ b/webapp/controller/StakingController.class.php @@ -1,6 +1,6 @@