This commit is contained in:
aozhiwei 2023-08-25 14:46:24 +08:00
parent e183c14106
commit 49ee8ade87

View File

@ -11,6 +11,7 @@ class Staking extends BaseModel {
public static function all($address) public static function all($address)
{ {
$result = array();
$rows = SqlHelper::ormSelect( $rows = SqlHelper::ormSelect(
myself()->_getMysql(''), myself()->_getMysql(''),
't_staking', 't_staking',
@ -18,7 +19,22 @@ class Staking extends BaseModel {
'address' => $address 'address' => $address
) )
); );
return $rows; foreach ($rows as $row) {
if ($row['nft_type'] == self::NFT721) {
if (!$row['item_id']) {
$itemId = 0;
$tokenType = 0;
if (!self::repair721NftInfo($row['token_id'], $row['contract_address'], $row['net_id'],
$row['start_time'], $itemId, $tokenType)) {
continue;
}
$row['item_id'] = $itemId;
$row['token_type'] = $tokenType;
}
}
array_push($result, $row);
}
return $result;
} }
public static function staked721($data, $netId) public static function staked721($data, $netId)