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

View File

@ -37,6 +37,13 @@ class Chip extends BaseModel
'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)

View File

@ -87,6 +87,19 @@ class Nft extends BaseModel {
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)
{
$nftList = array();