From 255d38f47bc360366579cae9f6d91c9843a2a734 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 24 Aug 2023 20:41:39 +0800 Subject: [PATCH] 1 --- webapp/controller/StakingController.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webapp/controller/StakingController.class.php b/webapp/controller/StakingController.class.php index b88cfa17..1932bdd8 100644 --- a/webapp/controller/StakingController.class.php +++ b/webapp/controller/StakingController.class.php @@ -104,6 +104,10 @@ class StackingController extends BaseAuthedController { $info['stake_time'] = $row['stake_time']; $info['txhash'] = $row['txhash']; $info['item_id'] = $row['item_id']; + $info['stacked_days'] = intval((myself()->_getNowDaySeconds() - + myself()->_getDaySeconds($row['start_time'])) / 3600 / 24); + $info['remain_days'] = max(0, intval($row['stake_time'] / 3600 / 24) - $info['stacked_days']); + array_push($items, $info); } @@ -132,7 +136,12 @@ class StackingController extends BaseAuthedController { $info['stake_time'] = $row['stake_time']; $info['txhash'] = $row['txhash']; $info['item_id'] = $row['item_id']; + $info['stacked_days'] = intval( + (myself()->_getNowDaySeconds() - + myself()->_getDaySeconds($row['start_time']) + 3600 *24) / 3600 / 24); + $info['remain_days'] = max(0, intval($row['stake_time'] / 3600 / 24) - $info['stacked_days']); + $info['total_rewards'] = $row['stacked_days'] *$info['daily_rewards']; array_push($items, $info); } }