Merge branch 'james_bc' of git.kingsome.cn:server/game2006api into james_bc

This commit is contained in:
hujiabin 2022-11-04 20:54:25 +08:00
commit 520da5bb66
2 changed files with 14 additions and 6 deletions

View File

@ -9,8 +9,10 @@ require_once('models/Bag.php');
require_once('models/Hero.php');
require_once('models/Gun.php');
require_once('models/Nft.php');
require_once('models/Chip.php');
require_once('models/Transaction.php');
require_once('models/BuyRecord.php');
require_once('models/Chip.php');
require_once('services/AwardService.php');
require_once('services/PropertyChgService.php');
@ -24,6 +26,7 @@ use models\Gun;
use models\Nft;
use models\Transaction;
use models\BuyRecord;
use models\Chip;
class BlockChainController extends BaseAuthedController {
@ -98,7 +101,7 @@ class BlockChainController extends BaseAuthedController {
break;
case 2:
{
$gunDb = Gun::find($uuid);
$gunDb = Gun::find($uniid);
if (!$gunDb) {
myself()->_rspErr(1, 'gun not found');
return;
@ -124,7 +127,7 @@ class BlockChainController extends BaseAuthedController {
}
));
}
$this->internalActivate721Nft($tokenId, Nft::GUN_TYPE, $gunDb['gun_uniid'], $gunDb['gun_id']);
$this->internalActivate721Nft($tokenId, Nft::EQUIP_TYPE, $gunDb['gun_uniid'], $gunDb['gun_id']);
}
break;
default:
@ -203,7 +206,7 @@ class BlockChainController extends BaseAuthedController {
array(
'action' => Transaction::EVOLVE_721_ACTION_TYPE,
'tokenId' => $nft1['token_id'],
'tokenType' => Nft::GUN_TYPE,
'tokenType' => Nft::EQUIP_TYPE,
'itemUniId' => $nft1['gun_uniid'],
'itemId' => $nft1['gun_id']
)
@ -484,9 +487,9 @@ class BlockChainController extends BaseAuthedController {
$transId,
Transaction::MINT_1155_ACTION_TYPE,
$tokenId,
$tokenType,
$itemUniId,
$itemId
Nft::CHIP_TYPE,
$itemDb['item_uniid'],
$itemDb['item_id']
);
myself()->_rspData(array(
'trans_id' => $transId,

View File

@ -23,6 +23,11 @@ class NftService extends BaseService {
'ring' => Nft::RING_TYPE,
);
public static function getChipBlance($account, $tokenId)
{
return Nft::getChipBlance($account, $tokenId);
}
public static function isHeroOwner($openId, $tokenId)
{
return self::internalIsOwner($openId, 'hero', $tokenId);