diff --git a/webapp/controller/InGameMallController.class.php b/webapp/controller/InGameMallController.class.php index ca98151f..0748a5a0 100644 --- a/webapp/controller/InGameMallController.class.php +++ b/webapp/controller/InGameMallController.class.php @@ -202,19 +202,19 @@ class InGameMallController extends BaseAuthedController { return; } switch ($itemMeta['type']){ -// case \mt\Item::HERO_TYPE : { -// $heroDb = Hero::find($goodsUniid); -// if (!$heroDb || !empty($heroDb['token_id']) || $heroDb['hero_id']!= $itemId){ -// $this->_rspErr(1, 'param goods_unnid error'); -// return; -// } -// if ($heroDb['seal_type'] != 1){ -// $this->_rspErr(1, 'Shelf heroes need to be packaged first'); -// return; -// } -// $orderField = $heroDb['quality']; -// } -// break; + case \mt\Item::HERO_TYPE : { + $heroDb = Hero::find($goodsUniid); + if (!$heroDb || !empty($heroDb['token_id']) || $heroDb['hero_id']!= $itemId){ + $this->_rspErr(1, 'param goods_unnid error'); + return; + } + if ($heroDb['seal_type'] != 1){ + $this->_rspErr(1, 'Shelf heroes need to be packaged first'); + return; + } + $orderField = $heroDb['quality']; + } + break; case \mt\Item::CHIP_TYPE : { $chipDb = Chip::find($goodsUniid); if (!$chipDb || !empty($chipDb['token_id']) || $chipDb['item_id']!= $itemId){ @@ -276,19 +276,19 @@ class InGameMallController extends BaseAuthedController { ) ); $propertyChgService->addChip(); - }//elseif ($itemMeta['type'] == \mt\Item::HERO_TYPE){ -// SqlHelper::update -// (myself()->_getSelfMysql(), -// 't_hero', -// array( -// 'idx' => $goodsUniid, -// ), -// array( -// 'account_id' => InGameMall::SYSTEM_MALL_ACCOUNT -// ) -// ); -// $propertyChgService->addHeroChg(); -// }elseif ($itemMeta['type'] == \mt\Item::GOLD_SYN){ + }elseif ($itemMeta['type'] == \mt\Item::HERO_TYPE){ + SqlHelper::update + (myself()->_getSelfMysql(), + 't_hero', + array( + 'idx' => $goodsUniid, + ), + array( + 'account_id' => InGameMall::SYSTEM_MALL_ACCOUNT + ) + ); + $propertyChgService->addHeroChg(); + }//elseif ($itemMeta['type'] == \mt\Item::GOLD_SYN){ // SqlHelper::update // (myself()->_getSelfMysql(), // 't_bag', @@ -362,6 +362,20 @@ class InGameMallController extends BaseAuthedController { $this->_decItems($costItems); switch ($goods['order_type']){ + case InGameMall::HERO_TYPE :{ + SqlHelper::update + (myself()->_getSelfMysql(), + 't_hero', + array( + 'idx' => $goods['goods_uniid'], + ), + array( + 'account_id' => myself()->_getAccountId() + ) + ); + $propertyChgService->addHeroChg(); + } + break; case InGameMall::CHIP_TYPE:{ SqlHelper::update (myself()->_getSelfMysql(), @@ -710,7 +724,7 @@ EOD; private function _isGoodsType($type){ if (in_array($type,array( -// \mt\Item::HERO_TYPE, + \mt\Item::HERO_TYPE, \mt\Item::CHIP_TYPE, \mt\Item::FRAGMENT_TYPE, \mt\Item::BATTLE_REWARD_BOX, @@ -727,9 +741,9 @@ EOD; return ; } switch ($itemMeta['type']){ -// case \mt\Item::HERO_TYPE : { -// return InGameMall::HERO_TYPE; -// } + case \mt\Item::HERO_TYPE : { + return InGameMall::HERO_TYPE; + } case \mt\Item::CHIP_TYPE : { return InGameMall::CHIP_TYPE; }