This commit is contained in:
aozhiwei 2023-08-28 15:40:09 +08:00
parent 1cb0754de7
commit f3b9792c6e
2 changed files with 6 additions and 1 deletions

View File

@ -66,7 +66,6 @@ class Staking(object):
'response': [ 'response': [
_common.RspHead(), _common.RspHead(),
['cec_rewards', 0, '该nft结算得到的ceg数量'], ['cec_rewards', 0, '该nft结算得到的ceg数量'],
['state', 0, '0:提前赎回 1:到期赎回'],
] ]
}, },
] ]

View File

@ -4,6 +4,8 @@ namespace models;
require_once("mt/Staking.php"); require_once("mt/Staking.php");
require_once("models/User.php");
use phpcommon\SqlHelper; use phpcommon\SqlHelper;
use mt; use mt;
@ -66,6 +68,7 @@ class Staking extends BaseModel {
$tokenId = $info[2]; $tokenId = $info[2];
$startTime = $info[3]; $startTime = $info[3];
$stakeTime = $info[4]; $stakeTime = $info[4];
$userDb = User::findByAddress($address);
SqlHelper::upsert( SqlHelper::upsert(
myself()->_getMysql(''), myself()->_getMysql(''),
't_staking', 't_staking',
@ -79,6 +82,7 @@ class Staking extends BaseModel {
), ),
array( array(
'account_id' => $userDb ? $userDb['account_id'] : '',
'address' => $address, 'address' => $address,
'token_id' => $tokenId, 'token_id' => $tokenId,
'token_type' => '0', 'token_type' => '0',
@ -143,6 +147,7 @@ class Staking extends BaseModel {
$tokenId = $info[2]; $tokenId = $info[2];
$startTime = $info[3]; $startTime = $info[3];
$stakeTime = $info[4]; $stakeTime = $info[4];
$userDb = User::findByAddress($address);
SqlHelper::upsert( SqlHelper::upsert(
myself()->_getMysql(''), myself()->_getMysql(''),
't_staking', 't_staking',
@ -158,6 +163,7 @@ class Staking extends BaseModel {
'status' => self::REDEEM_STATUS, 'status' => self::REDEEM_STATUS,
), ),
array( array(
'account_id' => $userDb ? $userDb['account_id'] : '',
'address' => $address, 'address' => $address,
'token_id' => $tokenId, 'token_id' => $tokenId,
'token_type' => '0', 'token_type' => '0',