diff --git a/webapp/controller/BlockChainController.class.php b/webapp/controller/BlockChainController.class.php index 897a5d94..5bcab723 100644 --- a/webapp/controller/BlockChainController.class.php +++ b/webapp/controller/BlockChainController.class.php @@ -212,23 +212,27 @@ class BlockChainController extends BaseAuthedController { myself()->_rspErr(1, 'token paramater error'); return; } - $costItems = array( - array( - 'item_id' => V_ITEM_GOLD, - 'item_num' => \services\FormulaService::Weapon_Advanced_CEG_Expend($nft1['quality']+1) - ), + //CEG扣除 + { + $costItems = array( + array( + 'item_id' => V_ITEM_GOLD, + 'item_num' => \services\FormulaService::Weapon_Advanced_CEG_Expend($nft1['quality']+1) + ), // array( // 'item_id' => V_ITEM_DIAMOND, // 'item_num' => \services\FormulaService::Weapon_Advanced_CEC_Expend($nft1['quality']+1) // ) - ); + ); - $lackItem = null; - if (!$this->_hasEnoughItems($costItems, $lackItem)) { - $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); - return; + $lackItem = null; + if (!$this->_hasEnoughItems($costItems, $lackItem)) { + $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); + return; + } + $this->_decItems($costItems); } - $this->_decItems($costItems); + $this->internalBcCall( array( 'c' => 'BcService', @@ -392,6 +396,37 @@ class BlockChainController extends BaseAuthedController { myself()->_getNowTime(), myself()->_getOpenId() ); + //CEG扣除 + { + if ($tokenType == Nft::HERO_TYPE){ + $costItems = array( + array( + 'item_id' => V_ITEM_GOLD, + 'item_num' => 100 + ), + ); + $lackItem = null; + if (!$this->_hasEnoughItems($costItems, $lackItem)) { + $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); + return; + } + $this->_decItems($costItems); + } + if ($tokenType == Nft::EQUIP_TYPE){ + $costItems = array( + array( + 'item_id' => V_ITEM_GOLD, + 'item_num' => 30 + ), + ); + $lackItem = null; + if (!$this->_hasEnoughItems($costItems, $lackItem)) { + $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); + return; + } + $this->_decItems($costItems); + } + } $params = array( 'c' => 'BcService', @@ -559,7 +594,10 @@ class BlockChainController extends BaseAuthedController { myself()->_rspErr(101, 'token_id paramater error'); return; } - +// //CEG扣除 +// { +// Chip::getChipByTokenId($chipIds); +// } $this->internalBcCall( array( 'c' => 'BcService', diff --git a/webapp/controller/GunController.class.php b/webapp/controller/GunController.class.php index b12ebeec..bfc81ac4 100644 --- a/webapp/controller/GunController.class.php +++ b/webapp/controller/GunController.class.php @@ -738,11 +738,17 @@ class GunController extends BaseAuthedController { 'unlock_time' => 0, ) ); + $newGunDb = Gun::findByTokenId2($tokenId); + $newGun = Gun::toDto($newGunDb); + $newGunDb['quality'] -= 1; + $oldGun = Gun::toDto($newGunDb); NftUpReceive::setAccountIdNull(myself()->_getAccountId(),$transId); $propertyChgService = new services\PropertyChgService(); $propertyChgService->addGunChg(); $this->_rspData(array( 'property_chg' => $propertyChgService->toDto(), + 'new_gun' =>$newGun, + 'old_gun'=>$oldGun )); }