1
This commit is contained in:
parent
31b87c2643
commit
68050c0079
@ -3,12 +3,12 @@
|
||||
require_once("mt/Staking.php");
|
||||
|
||||
require_once("models/Nft.php");
|
||||
require_once("models/Stacking.php");
|
||||
require_once("models/Staking.php");
|
||||
|
||||
use models\Nft;
|
||||
use models\Statcking;
|
||||
use models\Staking;
|
||||
|
||||
class StackingController extends BaseAuthedController {
|
||||
class StakingController extends BaseAuthedController {
|
||||
|
||||
const PLANET_TYPE = 1;
|
||||
const BADGE_TYPE = 2;
|
||||
@ -32,14 +32,14 @@ class StackingController extends BaseAuthedController {
|
||||
'is_open' => 0
|
||||
),
|
||||
);
|
||||
$rows = Stacking::all(myself()->_getAddress());
|
||||
$this->fillStackingInfo($info, 'planet', $rows);
|
||||
$this->fillStackingInfo($info, 'badge', $rows);
|
||||
$this->fillStackingInfo($info, 'cec', $rows);
|
||||
$rows = Staking::all(myself()->_getAddress());
|
||||
$this->fillStakingInfo($info, 'planet', $rows);
|
||||
$this->fillStakingInfo($info, 'badge', $rows);
|
||||
$this->fillStakingInfo($info, 'cec', $rows);
|
||||
myself()->_rspData($info);
|
||||
}
|
||||
|
||||
private function fillStackingInfo(&$info, $fieldName, $rows)
|
||||
private function fillStakingInfo(&$info, $fieldName, $rows)
|
||||
{
|
||||
$stackingInfo = $info[$fieldName];
|
||||
$stackingInfo['staked_quant'] = 0;
|
||||
@ -51,7 +51,7 @@ class StackingController extends BaseAuthedController {
|
||||
$stakingMeta = mt\Staking::get($row['item_id']);
|
||||
if ($this->isTypeNft($stackingInfo['type'], $row) && $stakingMeta) {
|
||||
$stakingDto = Staking::toDto($row);
|
||||
if ($stakingDto['status'] == Stacking::STAKING_STATUS) {
|
||||
if ($stakingDto['status'] == Staking::STAKING_STATUS) {
|
||||
if ($stakingDto['remain_days'] <= 0) {
|
||||
$stackingInfo['maturity_quant'] += $stakingDto['stacked_num'];
|
||||
} else {
|
||||
@ -75,11 +75,11 @@ class StackingController extends BaseAuthedController {
|
||||
$type = getReqVal('type', '');
|
||||
$stackedQuant = 0;
|
||||
$items = array();
|
||||
$rows = Stacking::all(myself()->_getAddress());
|
||||
$rows = Staking::all(myself()->_getAddress());
|
||||
foreach ($rows as $row) {
|
||||
if ($row['status'] == Stacking::STAKING_STATUS) {
|
||||
if ($row['status'] == Staking::STAKING_STATUS) {
|
||||
if ($this->isTypeNft($type, $row)) {
|
||||
array_push($items, Stacking::toDto($info));
|
||||
array_push($items, Staking::toDto($info));
|
||||
++$stackedQuant;
|
||||
}
|
||||
}
|
||||
@ -96,9 +96,9 @@ class StackingController extends BaseAuthedController {
|
||||
$items = array();
|
||||
$fromTime = getReqVal('from_time', '');
|
||||
$toTime = getReqVal('to_time', '');
|
||||
$rows = Stacking::all(myself()->_getAddress());
|
||||
$rows = Staking::all(myself()->_getAddress());
|
||||
foreach ($rows as $row) {
|
||||
if ($row['status'] == Stacking::REDEEM_STATUS) {
|
||||
if ($row['status'] == Staking::REDEEM_STATUS) {
|
||||
array_push($items, Staking::toDto($info));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user