From 49ee8ade8727e05b3bf47a86846c90bfb532277c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 25 Aug 2023 14:46:24 +0800 Subject: [PATCH] 1 --- webapp/models/Staking.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/webapp/models/Staking.php b/webapp/models/Staking.php index bd5eecd0..cae758ba 100644 --- a/webapp/models/Staking.php +++ b/webapp/models/Staking.php @@ -11,6 +11,7 @@ class Staking extends BaseModel { public static function all($address) { + $result = array(); $rows = SqlHelper::ormSelect( myself()->_getMysql(''), 't_staking', @@ -18,7 +19,22 @@ class Staking extends BaseModel { '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)