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': [
_common.RspHead(),
['cec_rewards', 0, '该nft结算得到的ceg数量'],
['state', 0, '0:提前赎回 1:到期赎回'],
]
},
]

View File

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