0"; $whereKv =array( 'owner_address' => myself()->_getOpenId(), ); $fragmentNft = myself()->_getMarketMysql()->execQuery($sql,$whereKv); return $fragmentNft; } public static function ToDto($row){ $itemMeta = mt\Item::get($row['token_id']); $name = 'XXX'; $type=0; if ($itemMeta && $itemMeta['type'] == mt\Item::FRAGMENT_TYPE){ $name = $itemMeta['name']; switch ($itemMeta['sub_type']){ case 1 : $type=1; break; case 2 : $type = 2; break; case 3 : $type=1; break; case 4 : $type=2; break; default:$type=0; } } $dto = array( // 'owner_address' => $row['owner_address'], 'token_id' => $row['token_id'], 'item_id' => $row['token_id'], 'balance' => $row['balance'], 'createtime' => $row['createtime'], 'modifytime' => $row['modifytime'], ); $nft_address = ''; if ($row['token_id']){ $nft_address = SERVER_ENV == _ONLINE ? '0xFc21A863bFb4E4534B246078772e2074e076f0a7' : '0x0E696947A06550DEf604e82C26fd9E493e576337'; } $dto['nft_address'] = $nft_address; $dto['name'] = $name; $dto['type'] = $type; return $dto; } public static function oldToDto($row){ $itemMeta = mt\Item::get($row['token_id']); $dto = array(); if ($itemMeta){ $dto = array( 'token_id' => $row['token_id'], 'item_id' => $row['token_id'], 'type' => $itemMeta['sub_type'], 'parts' => substr($itemMeta['id'],-2,1), 'balance' => $row['balance'], 'createtime' => $row['createtime'], 'modifytime' => $row['modifytime'], ); } return $dto; } }