1
This commit is contained in:
parent
47da5c5ee7
commit
9e3f4e2b11
@ -164,6 +164,25 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
myself()->_rspErr(1, 'token paramater error');
|
myself()->_rspErr(1, 'token paramater error');
|
||||||
return;
|
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(
|
$this->internalBcCall(
|
||||||
array(
|
array(
|
||||||
'c' => 'BcService',
|
'c' => 'BcService',
|
||||||
@ -193,6 +212,23 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
myself()->_rspErr(1, 'token paramater error');
|
myself()->_rspErr(1, 'token paramater error');
|
||||||
return;
|
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(
|
$this->internalBcCall(
|
||||||
array(
|
array(
|
||||||
'c' => 'BcService',
|
'c' => 'BcService',
|
||||||
|
@ -901,11 +901,18 @@ class HeroController extends BaseAuthedController {
|
|||||||
'unlock_time' => 0,
|
'unlock_time' => 0,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$newHeroDb = Hero::findByTokenId2($tokenId);
|
||||||
|
$newHero = Hero::toDto($newHeroDb);
|
||||||
|
$newHeroDb['quality'] -= 1;
|
||||||
|
$oldHero = Hero::toDto($newHeroDb);
|
||||||
NftUpReceive::setAccountIdNull(myself()->_getAccountId(),$transId);
|
NftUpReceive::setAccountIdNull(myself()->_getAccountId(),$transId);
|
||||||
|
|
||||||
$propertyChgService = new services\PropertyChgService();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
$propertyChgService->addHeroChg();
|
$propertyChgService->addHeroChg();
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
'property_chg' => $propertyChgService->toDto(),
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
'new_hero' =>$newHero,
|
||||||
|
'old_hero'=>$oldHero
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user