1
This commit is contained in:
parent
4e0980b032
commit
d347361624
@ -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',
|
||||
|
@ -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
|
||||
));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user