diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 276d8d3c..8a7cfd2f 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -141,7 +141,10 @@ class ShopController extends BaseAuthedController { } $costItemId = $this->getCostItemIdByTokenType($tokenType); - $costItems = $this->makeCostItems($costItemId, $goodsNum * $needPrice); + $costItems = array( + 'item_id' => $costItemId, + 'item_num' => $goodsNum * $needPrice + ); if (!in_array( $tokenType, array( @@ -160,7 +163,11 @@ class ShopController extends BaseAuthedController { ShopBuyRecord::add($id, $goodsNum); $this->_decItems($costItems); for ($i = 0; $i < $goodsNum; $i++) { - $this->internalAddItem($propertyChgService, $itemMeta, $goodsMeta['goods_num'], 0); + $this->internalAddItem($awardService, + $propertyChgService, + $itemMeta, + $goodsMeta['goods_num'], + 0); } $propertyChgService->addUserChg(); $this->_rspData( @@ -387,18 +394,11 @@ class ShopController extends BaseAuthedController { } } - private function makeCostItems($item_id, $num) - { - $costItems = array( - array( - 'item_id' => $item_id, - 'item_num' => $num - ) - ); - return $costItems; - } - - private function internalAddItem($propertyChgService, $itemMeta, $count, $grade = null) + private function internalAddItem($awardService, + $propertyChgService, + $itemMeta, + $count, + $grade = null) { switch ($itemMeta['type']) { case mt\Item::HERO_TYPE: