1
This commit is contained in:
parent
eebc0f5a6e
commit
1be655ea80
@ -626,50 +626,51 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//CEG扣除
|
//CEG扣除
|
||||||
// {
|
{
|
||||||
// $costSum = 0;
|
$costSum = 0;
|
||||||
// foreach ($chipIds as $chipId){
|
foreach ($chipIds as $chipId){
|
||||||
// $chipDb = Chip::getChipByTokenId($chipId);
|
$chipDb = Chip::getChipByTokenId($chipId);
|
||||||
// if ($chipDb){
|
if ($chipDb){
|
||||||
// $tiliDiff = $chipDb['strength_max'] - $chipDb['strength'];
|
$tiliDiff = $chipDb['strength_max'] - $chipDb['strength'];
|
||||||
// $costSum += \services\FormulaService::Chip_Demount_Mint($tiliDiff);
|
$costSum += \services\FormulaService::Chip_Demount_Mint($tiliDiff);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if ($costSum > 0){
|
$decFeeCb = null;
|
||||||
// $costItems = array(
|
if ($costSum > 0){
|
||||||
// array(
|
$costItems = array(
|
||||||
// 'item_id' => V_ITEM_GOLD,
|
array(
|
||||||
// 'item_num' => $costSum
|
'item_id' => V_ITEM_GOLD,
|
||||||
// ),
|
'item_num' => $costSum
|
||||||
// );
|
),
|
||||||
// $lackItem = null;
|
);
|
||||||
// if (!$this->_hasEnoughItems($costItems, $lackItem)) {
|
$lackItem = null;
|
||||||
// $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem));
|
if (!$this->_hasEnoughItems($costItems, $lackItem)) {
|
||||||
// return;
|
$this->_rspErr(3, $this->_getLackItemErrMsg($lackItem));
|
||||||
// }
|
return;
|
||||||
// $decFeeCb = function ($transId) use ($costItems){
|
}
|
||||||
// myself()->_decItems($costItems);
|
$decFeeCb = function ($transId) use ($costItems){
|
||||||
// foreach ($costItems as $costItem){
|
myself()->_decItems($costItems);
|
||||||
// TransactionPrefee::add($transId,$costItem);
|
foreach ($costItems as $costItem){
|
||||||
// }
|
TransactionPrefee::add($transId,$costItem);
|
||||||
// };
|
}
|
||||||
// foreach ($chipIds as $chipId){
|
};
|
||||||
// $chipDb = Chip::getChipByTokenId($chipId);
|
foreach ($chipIds as $chipId){
|
||||||
// $items = array(
|
$chipDb = Chip::getChipByTokenId($chipId);
|
||||||
// 'token_id' => $chipDb['token_id'],
|
$items = array(
|
||||||
// 'token_type' => $chipDb['chip_type'],
|
'token_id' => $chipDb['token_id'],
|
||||||
// 'item_id' => self::TEST_ITEM_ID,
|
'token_type' => $chipDb['chip_type'],
|
||||||
// 'item_num' => $chipDb['strength_max'] - $chipDb['strength']
|
'item_id' => self::TEST_ITEM_ID,
|
||||||
// );
|
'item_num' => $chipDb['strength_max'] - $chipDb['strength']
|
||||||
// Chip::update($chipId,array(
|
);
|
||||||
// 'strength'=>$chipDb['strength_max']
|
Chip::update($chipId,array(
|
||||||
// ));
|
'strength'=>$chipDb['strength_max']
|
||||||
// $decFeeCb = function ($transId) use ($items){
|
));
|
||||||
// TransactionPrefee::add($transId,$items);
|
$decFeeCb = function ($transId) use ($items){
|
||||||
// };
|
TransactionPrefee::add($transId,$items);
|
||||||
// }
|
};
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
}
|
||||||
$this->internalBcCall(
|
$this->internalBcCall(
|
||||||
array(
|
array(
|
||||||
'c' => 'BcService',
|
'c' => 'BcService',
|
||||||
@ -688,7 +689,8 @@ class BlockChainController extends BaseAuthedController {
|
|||||||
'tokenType' => Nft::HERO_TYPE,
|
'tokenType' => Nft::HERO_TYPE,
|
||||||
'itemUniId' => $heroDb['hero_uniid'],
|
'itemUniId' => $heroDb['hero_uniid'],
|
||||||
'itemId' => $heroDb['hero_id']
|
'itemId' => $heroDb['hero_id']
|
||||||
)
|
),
|
||||||
|
$decFeeCb
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ class Chip extends BaseModel
|
|||||||
$row['rand_attr'] = $attrs;
|
$row['rand_attr'] = $attrs;
|
||||||
$row['today_get_gold'] = $todayGetGold;
|
$row['today_get_gold'] = $todayGetGold;
|
||||||
$row['last_get_gold_time'] = $lastGetGoldTime;
|
$row['last_get_gold_time'] = $lastGetGoldTime;
|
||||||
$row['belong_to_item_id'] = self::belongsToWhereOld($row);
|
// $row['belong_to_item_id'] = self::belongsToWhereOld($row);
|
||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,10 +149,7 @@ class Chip extends BaseModel
|
|||||||
$tokenId = $row['token_id'];
|
$tokenId = $row['token_id'];
|
||||||
$sql = "select * from t_chip_plugin where chip1=:tokenId or chip2=:tokenId or chip3=:tokenId or chip4=:tokenId limit 1";
|
$sql = "select * from t_chip_plugin where chip1=:tokenId or chip2=:tokenId or chip3=:tokenId or chip4=:tokenId limit 1";
|
||||||
$whereKv =array(
|
$whereKv =array(
|
||||||
'chip1' => $tokenId,
|
'tokenId' => $tokenId
|
||||||
'chip2' => $tokenId,
|
|
||||||
'chip3' => $tokenId,
|
|
||||||
'chip4' => $tokenId,
|
|
||||||
);
|
);
|
||||||
$ChipPluginDb = myself()->_getMarketMysql()->execQuery($sql,$whereKv);
|
$ChipPluginDb = myself()->_getMarketMysql()->execQuery($sql,$whereKv);
|
||||||
if (!$ChipPluginDb){
|
if (!$ChipPluginDb){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user