1
This commit is contained in:
parent
95765d9d14
commit
6d3fc1336f
@ -81,7 +81,7 @@ CREATE TABLE `t_staking` (
|
|||||||
`stacked_num` varchar(60) NOT NULL DEFAULT '' COMMENT 'stacked_num',
|
`stacked_num` varchar(60) NOT NULL DEFAULT '' COMMENT 'stacked_num',
|
||||||
`start_time` bigint NOT NULL DEFAULT '0' COMMENT '质押开始时间',
|
`start_time` bigint NOT NULL DEFAULT '0' COMMENT '质押开始时间',
|
||||||
`stake_time` bigint NOT NULL DEFAULT '0' COMMENT '质押结束时间',
|
`stake_time` bigint NOT NULL DEFAULT '0' COMMENT '质押结束时间',
|
||||||
`unstake_time` bigint NOT NULL DEFAULT '0' COMMENT '解押结束时间',
|
`redeem_time` bigint NOT NULL DEFAULT '0' COMMENT '赎回时间',
|
||||||
`status` int(11) NOT NULL COMMENT '0:质押中 1:已解押',
|
`status` int(11) NOT NULL COMMENT '0:质押中 1:已解押',
|
||||||
`txhash` varchar(255) NOT NULL DEFAULT '' COMMENT 'txhash',
|
`txhash` varchar(255) NOT NULL DEFAULT '' COMMENT 'txhash',
|
||||||
`nft_type` int(11) NOT NULL COMMENT '',
|
`nft_type` int(11) NOT NULL COMMENT '',
|
||||||
|
@ -5,7 +5,7 @@ namespace models;
|
|||||||
class Staking extends BaseModel {
|
class Staking extends BaseModel {
|
||||||
|
|
||||||
const STAKING_STATUS = 0;
|
const STAKING_STATUS = 0;
|
||||||
const UNSTAKE_STATUS = 1;
|
const REDEEM_STATUS = 1;
|
||||||
|
|
||||||
const NFT721 = 1;
|
const NFT721 = 1;
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ class Staking extends BaseModel {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function redeem721($data, $netId, $unstakeTime)
|
public static function redeem721($data, $netId, $redeemTime, $txHash)
|
||||||
{
|
{
|
||||||
$address = $data['address'];
|
$address = $data['address'];
|
||||||
foreach ($data['infos'] as $info) {
|
foreach ($data['infos'] as $info) {
|
||||||
@ -108,8 +108,9 @@ class Staking extends BaseModel {
|
|||||||
'start_time' => $info['start'],
|
'start_time' => $info['start'],
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'unstake_time' => $unstakeTime,
|
'txhash' => $txHash,
|
||||||
'status' => self::UNSTAKE_STATUS,
|
'redeem_time' => $redeemTime,
|
||||||
|
'status' => self::REDEEM_STATUS,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'address' => $address,
|
'address' => $address,
|
||||||
@ -120,8 +121,9 @@ class Staking extends BaseModel {
|
|||||||
'stacked_num' => 1,
|
'stacked_num' => 1,
|
||||||
'start_time' => $info['start'],
|
'start_time' => $info['start'],
|
||||||
'stake_time' => $info['stakeTime'],
|
'stake_time' => $info['stakeTime'],
|
||||||
'unstake_time' => $unstakeTime,
|
'txhash' => $txHash,
|
||||||
'status' => self::UNSTAKE_STATUS,
|
'redeem_time' => $redeemTime,
|
||||||
|
'status' => self::REDEEM_STATUS,
|
||||||
'nft_type' => self::NFT721,
|
'nft_type' => self::NFT721,
|
||||||
'createtime' => myself()->_getNowTime(),
|
'createtime' => myself()->_getNowTime(),
|
||||||
'modifytime' => myself()->_getNowTime(),
|
'modifytime' => myself()->_getNowTime(),
|
||||||
|
@ -26,7 +26,9 @@ class Redeem721
|
|||||||
SignatureService::web3ServiceCheck();
|
SignatureService::web3ServiceCheck();
|
||||||
$data = json_decode(getReqVal('data', ''), true);
|
$data = json_decode(getReqVal('data', ''), true);
|
||||||
$netId = getReqVal('net_id', '');
|
$netId = getReqVal('net_id', '');
|
||||||
Stacking::redeem721($data, $netId, myself()->_getNowTime());
|
$redeemTime = getReqVal('redeem_time', '');
|
||||||
|
$txHash = getReqVal('txhash', '');
|
||||||
|
Stacking::redeem721($data, $netId, $redeemTime, $txHash);
|
||||||
myself()->_rspOk();
|
myself()->_rspOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user