Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb

This commit is contained in:
hujiabin 2023-08-28 15:16:55 +08:00
commit 6d43cacd1f
4 changed files with 24 additions and 0 deletions

View File

@ -54,4 +54,19 @@ class Staking(object):
['!items', [_common.StakingDetail()], '领取历史'],
]
},
{
'name': 'redeemPreview',
'desc': '赎回预览',
'group': 'Staking',
'url': 'webapp/index.php?c=Staking&a=redeemPreview',
'params': [
_common.ReqHead(),
['trans_id', '', 'trans_id'],
],
'response': [
_common.RspHead(),
['cec_rewards', 0, '该nft结算得到的ceg数量'],
['state', 0, '0:提前赎回 1:到期赎回'],
]
},
]

View File

@ -1436,10 +1436,12 @@ class StakingDetail(object):
def __init__(self):
self.fields = [
['trans_id', '', '本次质押交易唯一id'],
['token_id', '', 'token id'],
['token_type', '', 'token type'],
['contract_address', '', 'contract address'],
['net_id', '', 'net_id'],
['order_id', '', 'order_id'],
['start_time', '', '质押开始时间'],
['stake_time', '', '质押时间'],
['txhash', '', 'txhash'],

View File

@ -107,6 +107,11 @@ class StakingController extends BaseAuthedController {
));
}
public function redeemPreview()
{
$transId = getReqVal('trans_id', 0);
}
private function isTypeNft($type, $dbInfo)
{
switch ($type) {

View File

@ -183,10 +183,12 @@ class Staking extends BaseModel {
{
$stakingMeta = mt\Staking::get($row['item_id']);
$dto = array(
'trans_id' => $row['idx'],
'token_id' => $row['token_id'],
'token_type' => $row['token_type'],
'contract_address' => $row['contract_address'],
'net_id' => $row['net_id'],
'order_id' => $row['order_id'],
'start_time' => $row['start_time'],
'stake_time' => $row['stake_time'],
'txhash' => $row['txhash'],