1
This commit is contained in:
parent
7614d7ff24
commit
5888f6d675
@ -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']
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user