1
This commit is contained in:
parent
d5a4778826
commit
88b9f2dfba
@ -19,4 +19,72 @@ class Staking extends BaseModel {
|
|||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function staked721($data, $netId)
|
||||||
|
{
|
||||||
|
$address = $data['address'];
|
||||||
|
foreach ($data['infos'] as $info) {
|
||||||
|
SqlHelper::upsert(
|
||||||
|
myself()->_getMysql(''),
|
||||||
|
't_staking',
|
||||||
|
array(
|
||||||
|
'token_id' => $info['tokenid'],
|
||||||
|
'contract_address' => $info['nft'],
|
||||||
|
'net_id' => $netId,
|
||||||
|
'start_time' => $info['start'],
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'address' => $address,
|
||||||
|
'token_id' => $info['tokenid'],
|
||||||
|
'token_type' => '0',
|
||||||
|
'net_id' => $netId,
|
||||||
|
'contract_address' => $info['nft'],
|
||||||
|
'stacked_num' => 1,
|
||||||
|
'start_time' => $info['start'],
|
||||||
|
'stake_time' => $info['stakeTime'],
|
||||||
|
'status' => self::STAKING_STATUS,
|
||||||
|
'createtime' => myself()->_getNowTime(),
|
||||||
|
'modifytime' => myself()->_getNowTime(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function redeem721($data, $netId, $unstakeTime)
|
||||||
|
{
|
||||||
|
$address = $data['address'];
|
||||||
|
foreach ($data['infos'] as $info) {
|
||||||
|
SqlHelper::upsert(
|
||||||
|
myself()->_getMysql(''),
|
||||||
|
't_staking',
|
||||||
|
array(
|
||||||
|
'token_id' => $info['tokenid'],
|
||||||
|
'contract_address' => $info['nft'],
|
||||||
|
'net_id' => $netId,
|
||||||
|
'start_time' => $info['start'],
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'unstake_time' => $unstakeTime,
|
||||||
|
'status' => self::UNSTAKE_STATUS,
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'address' => $address,
|
||||||
|
'token_id' => $info['tokenid'],
|
||||||
|
'token_type' => '0',
|
||||||
|
'net_id' => $netId,
|
||||||
|
'contract_address' => $info['nft'],
|
||||||
|
'stacked_num' => 1,
|
||||||
|
'start_time' => $info['start'],
|
||||||
|
'stake_time' => $info['stakeTime'],
|
||||||
|
'unstake_time' => $unstakeTime,
|
||||||
|
'status' => self::UNSTAKE_STATUS,
|
||||||
|
'createtime' => myself()->_getNowTime(),
|
||||||
|
'modifytime' => myself()->_getNowTime(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace services;
|
namespace services;
|
||||||
|
|
||||||
require_once ('services/callback/common/SignatureService.php');
|
|
||||||
require_once('mt/Item.php');
|
require_once('mt/Item.php');
|
||||||
require_once('mt/Hero.php');
|
require_once('mt/Hero.php');
|
||||||
require_once('mt/Parameter.php');
|
require_once('mt/Parameter.php');
|
||||||
|
|
||||||
|
require_once ('modules/Stacking.php');
|
||||||
|
|
||||||
|
require_once ('services/callback/common/SignatureService.php');
|
||||||
|
|
||||||
|
use phpcommon\SqlHelper;
|
||||||
|
|
||||||
use mt\Item;
|
use mt\Item;
|
||||||
use mt\Hero;
|
use mt\Hero;
|
||||||
use mt\Parameter;
|
use mt\Parameter;
|
||||||
use phpcommon\SqlHelper;
|
|
||||||
|
use modules\Stacking;
|
||||||
|
|
||||||
class Staked721
|
class Staked721
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user