This commit is contained in:
aozhiwei 2022-11-04 14:13:49 +08:00
parent 7614d7ff24
commit 5888f6d675
3 changed files with 28 additions and 2 deletions

View File

@ -205,6 +205,12 @@ class BlockChainController extends BaseAuthedController {
return; return;
} }
$nftDb = Chip::findByTokenId($tokenId1);
if (!$nftDb) {
myself()->_rspErr(1, 'token_id1 paramater error');
return;
}
$this->internalBcCall( $this->internalBcCall(
array( array(
'c' => 'BcService', 'c' => 'BcService',
@ -219,8 +225,8 @@ class BlockChainController extends BaseAuthedController {
'action' => Transaction::EVOLVE_CHIP_ACTION_TYPE, 'action' => Transaction::EVOLVE_CHIP_ACTION_TYPE,
'tokenId' => $tokenId1, 'tokenId' => $tokenId1,
'itemType' => 0, 'itemType' => 0,
'itemUniId' => 0, 'itemUniId' => $nftDb['chip_uniid'],
'itemId' => 0 'itemId' => $nftDb['item_id']
) )
); );
} }

View File

@ -37,6 +37,13 @@ class Chip extends BaseModel
'token_id' => $tokenId 'token_id' => $tokenId
) )
); );
if ($row) {
$row['chip_uniid'] = $row['idx'];
if (NftService::getChipBlance(myself()->_getOpenId(), $tokenId) <= 0) {
$row = null;
}
}
return $row;
} }
public static function getChipList($cb) public static function getChipList($cb)

View File

@ -87,6 +87,19 @@ class Nft extends BaseModel {
return $nftList; return $nftList;
} }
public static function getChipBlance($account, $tokenId)
{
$row = SqlHelper::ormSelectOne(
myself()->_getMarketMysql(),
't_nft1155',
array(
'owner_address' => $account,
'token_id' => $tokenId,
)
);
return $row ? $row['balance'] : 0;
}
public static function getNftListByType($account, $type) public static function getNftListByType($account, $type)
{ {
$nftList = array(); $nftList = array();