diff --git a/webapp/controller/BlockChainController.class.php b/webapp/controller/BlockChainController.class.php index e94842e6..dd19d77f 100644 --- a/webapp/controller/BlockChainController.class.php +++ b/webapp/controller/BlockChainController.class.php @@ -164,6 +164,25 @@ class BlockChainController extends BaseAuthedController { myself()->_rspErr(1, 'token paramater error'); return; } + //CEG扣除 + { + $costItems = array( + array( + 'item_id' => V_ITEM_GOLD, + 'item_num' => \services\FormulaService::Hero_Advanced_CEG_Expend($nft1['quality']+1) + ), +// array( +// 'item_id' => V_ITEM_DIAMOND, +// 'item_num' => \services\FormulaService::Hero_Advanced_CEC_Expend($nft1['quality']+1) +// ) + ); + $lackItem = null; + if (!$this->_hasEnoughItems($costItems, $lackItem)) { + $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); + return; + } + $this->_decItems($costItems); + } $this->internalBcCall( array( 'c' => 'BcService', @@ -193,6 +212,23 @@ 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) + ), +// 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; + } + $this->_decItems($costItems); $this->internalBcCall( array( 'c' => 'BcService', diff --git a/webapp/controller/HeroController.class.php b/webapp/controller/HeroController.class.php index 6d59e210..b065694f 100644 --- a/webapp/controller/HeroController.class.php +++ b/webapp/controller/HeroController.class.php @@ -901,11 +901,18 @@ class HeroController extends BaseAuthedController { 'unlock_time' => 0, ) ); + $newHeroDb = Hero::findByTokenId2($tokenId); + $newHero = Hero::toDto($newHeroDb); + $newHeroDb['quality'] -= 1; + $oldHero = Hero::toDto($newHeroDb); NftUpReceive::setAccountIdNull(myself()->_getAccountId(),$transId); + $propertyChgService = new services\PropertyChgService(); $propertyChgService->addHeroChg(); $this->_rspData(array( 'property_chg' => $propertyChgService->toDto(), + 'new_hero' =>$newHero, + 'old_hero'=>$oldHero )); } }