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();
switch ($nftDb['token_type']){
case Nft::HERO_TYPE : {
$heroDb = Hero::findByTokenId($nftDb['token_id']);
$heroDb = Hero::findByTokenId2($nftDb['token_id']);
if ($heroDb){
$details = Hero::toDto($heroDb);
}
}
break;
case Nft::EQUIP_TYPE : {
$gunDb = Gun::findByTokenId($nftDb['token_id']);
$gunDb = Gun::findByTokenId2($nftDb['token_id']);
if ($gunDb){
$details = Gun::toDto($gunDb);
}
}
break;
case Nft::CHIP_TYPE : {
$chipDb = Chip::findByTokenId($nftDb['token_id']);
$chipDb = Chip::findByTokenId2($nftDb['token_id']);
if ($chipDb){
$details = Chip::toDto($chipDb);
}

View File

@ -77,6 +77,18 @@ class Chip extends BaseModel
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)
{
SqlHelper::ormSelect(