This commit is contained in:
hujiabin 2023-06-13 15:31:49 +08:00
parent db1dfa1a5f
commit bbf091b8bd
2 changed files with 15 additions and 3 deletions

View File

@ -71,21 +71,21 @@ class NftController extends BaseAuthedController
$details = array(); $details = array();
switch ($nftDb['token_type']){ switch ($nftDb['token_type']){
case Nft::HERO_TYPE : { case Nft::HERO_TYPE : {
$heroDb = Hero::findByTokenId($nftDb['token_id']); $heroDb = Hero::findByTokenId2($nftDb['token_id']);
if ($heroDb){ if ($heroDb){
$details = Hero::toDto($heroDb); $details = Hero::toDto($heroDb);
} }
} }
break; break;
case Nft::EQUIP_TYPE : { case Nft::EQUIP_TYPE : {
$gunDb = Gun::findByTokenId($nftDb['token_id']); $gunDb = Gun::findByTokenId2($nftDb['token_id']);
if ($gunDb){ if ($gunDb){
$details = Gun::toDto($gunDb); $details = Gun::toDto($gunDb);
} }
} }
break; break;
case Nft::CHIP_TYPE : { case Nft::CHIP_TYPE : {
$chipDb = Chip::findByTokenId($nftDb['token_id']); $chipDb = Chip::findByTokenId2($nftDb['token_id']);
if ($chipDb){ if ($chipDb){
$details = Chip::toDto($chipDb); $details = Chip::toDto($chipDb);
} }

View File

@ -77,6 +77,18 @@ class Chip extends BaseModel
return $row; return $row;
} }
public static function findByTokenId2($tokenId)
{
$row = SqlHelper::ormSelectOne(
myself()->_getMysql($tokenId),
't_chip',
array(
'token_id' => $tokenId,
)
);
return $row;
}
public static function getChipList($cb) public static function getChipList($cb)
{ {
SqlHelper::ormSelect( SqlHelper::ormSelect(