1
This commit is contained in:
parent
4e0980b032
commit
d347361624
@ -212,6 +212,8 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
myself()->_rspErr(1, 'token paramater error');
|
myself()->_rspErr(1, 'token paramater error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//CEG扣除
|
||||||
|
{
|
||||||
$costItems = array(
|
$costItems = array(
|
||||||
array(
|
array(
|
||||||
'item_id' => V_ITEM_GOLD,
|
'item_id' => V_ITEM_GOLD,
|
||||||
@ -229,6 +231,8 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->_decItems($costItems);
|
$this->_decItems($costItems);
|
||||||
|
}
|
||||||
|
|
||||||
$this->internalBcCall(
|
$this->internalBcCall(
|
||||||
array(
|
array(
|
||||||
'c' => 'BcService',
|
'c' => 'BcService',
|
||||||
@ -392,6 +396,37 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
myself()->_getNowTime(),
|
myself()->_getNowTime(),
|
||||||
myself()->_getOpenId()
|
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(
|
$params = array(
|
||||||
'c' => 'BcService',
|
'c' => 'BcService',
|
||||||
@ -559,7 +594,10 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
myself()->_rspErr(101, 'token_id paramater error');
|
myself()->_rspErr(101, 'token_id paramater error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// //CEG扣除
|
||||||
|
// {
|
||||||
|
// Chip::getChipByTokenId($chipIds);
|
||||||
|
// }
|
||||||
$this->internalBcCall(
|
$this->internalBcCall(
|
||||||
array(
|
array(
|
||||||
'c' => 'BcService',
|
'c' => 'BcService',
|
||||||
|
@ -738,11 +738,17 @@ class GunController extends BaseAuthedController {
|
|||||||
'unlock_time' => 0,
|
'unlock_time' => 0,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$newGunDb = Gun::findByTokenId2($tokenId);
|
||||||
|
$newGun = Gun::toDto($newGunDb);
|
||||||
|
$newGunDb['quality'] -= 1;
|
||||||
|
$oldGun = Gun::toDto($newGunDb);
|
||||||
NftUpReceive::setAccountIdNull(myself()->_getAccountId(),$transId);
|
NftUpReceive::setAccountIdNull(myself()->_getAccountId(),$transId);
|
||||||
$propertyChgService = new services\PropertyChgService();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
$propertyChgService->addGunChg();
|
$propertyChgService->addGunChg();
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
'property_chg' => $propertyChgService->toDto(),
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
'new_gun' =>$newGun,
|
||||||
|
'old_gun'=>$oldGun
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user