diff --git a/webapp/controller/BlockChainController.class.php b/webapp/controller/BlockChainController.class.php index 3a1b6cb1..def4ab2a 100644 --- a/webapp/controller/BlockChainController.class.php +++ b/webapp/controller/BlockChainController.class.php @@ -648,27 +648,26 @@ class BlockChainController extends BaseAuthedController { $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); return; } - $decFeeCb = function ($transId) use ($costItems){ + $decFeeCb = function ($transId) use ($costItems, $chipIds){ myself()->_decItems($costItems); foreach ($costItems as $costItem){ TransactionPrefee::add($transId,$costItem); } - }; - foreach ($chipIds as $chipId){ - $chipDb = Chip::getChipByTokenId($chipId); - $items = array( - 'token_id' => $chipDb['token_id'], - 'token_type' => $chipDb['chip_type'], - 'item_id' => self::TEST_ITEM_ID, - 'item_num' => $chipDb['strength_max'] - $chipDb['strength'] - ); - Chip::update($chipId,array( - 'strength'=>$chipDb['strength_max'] - )); - $decFeeCb = function ($transId) use ($items){ + + foreach ($chipIds as $chipId){ + $chipDb = Chip::getChipByTokenId($chipId); + $items = array( + 'token_id' => $chipDb['token_id'], + 'token_type' => $chipDb['chip_type'], + 'item_id' => self::TEST_ITEM_ID, + 'item_num' => $chipDb['strength_max'] - $chipDb['strength'] + ); + Chip::update($chipId,array( + 'strength'=>$chipDb['strength_max'] + )); TransactionPrefee::add($transId,$items); - }; - } + } + }; } } $this->internalBcCall(