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); } }