diff --git a/webapp/controller/HeroSkillController.class.php b/webapp/controller/HeroSkillController.class.php index c9cee0b5..470eb453 100644 --- a/webapp/controller/HeroSkillController.class.php +++ b/webapp/controller/HeroSkillController.class.php @@ -11,11 +11,12 @@ use phpcommon\SqlHelper; class HeroSkillController extends BaseAuthedController { public function getSkillList(){ - $skillList = \mt\Skill::getPresetSkill(); - $list = array(); - foreach ($skillList as $skill){ - $list[] = $skill['skill_id']; - } +// $skillList = \mt\Skill::getPresetSkill(); +// $list = array(); +// foreach ($skillList as $skill){ +// $list[] = $skill['skill_id']; +// } + $list = array(10101,10201,10301,10401,10501); $this->_rspData(array( 'data' => $list, )); diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 60892008..c5d319d2 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -47,7 +47,7 @@ class UserController extends BaseAuthedController { $userInfo = $this->_safeGetOrmUserInfo(); if (!$userInfo) { $this->createNewUserV2($userName); - $this->_addFreeItem(); //送 50 Test_CEG + $this->_addFreeItem2(); //送 50 Test_CEG $userInfo = $this->_getOrmUserInfo(); $this->_setV(TN_RANK_STATUS, 0, 1); } @@ -65,6 +65,68 @@ class UserController extends BaseAuthedController { $this->_incDailyV(TN_DAILY_LOGINS, 0, 1); } + private function _addFreeItem2(){ + //添加芯片 + $chipMeta = \mt\Item::getMetaListByType(\mt\Item::CHIP_TYPE); + $chip1 = array(); + $chip2 = array(); + $chip3 = array(); + foreach ($chipMeta as $row){ + if ($row['sub_type'] == 1){ + array_push($chip1,$row); + }else if($row['sub_type'] == 2){ + array_push($chip2,$row); + }else if($row['sub_type'] == 3){ + array_push($chip3,$row); + } + } + for ($i=1;$i<=20;$i++){ + $row1 = $chip1[array_rand($chip1)]; + Chip::addChip($row1); + $row2 = $chip2[array_rand($chip2)]; + Chip::addChip($row2); + $row3 = $chip3[array_rand($chip3)]; + Chip::addChip($row3); + } + //添加枪械和Gold + $addItems =array(); + foreach (mt\Parameter::getListValue('creator_present_items') as $itemsStr) { + list($itemId, $itemNum) = explode(':', $itemsStr); + if ($itemNum > 0) { + array_push($addItems, + array( + 'item_id' => $itemId, + 'item_num' => $itemNum + )); + } + } + array_push($addItems, + array( + 'item_id' => V_ITEM_GOLD, + 'item_num' => 100000 + )); + array_push($addItems, + array( + 'item_id' => V_ITEM_DIAMOND, + 'item_num' => 100000 + )); + $awardService = new services\AwardService(); + $propertyChgService = new services\PropertyChgService(); + $this->_addItems($addItems, $awardService, $propertyChgService); + + //添加英雄和皮肤 + $itemIds = array(30700,30900,31000,40701,40702,40901,40902,41001); + $addItems2 =array(); + foreach ($itemIds as $row){ + array_push($addItems2, + array( + 'item_id' => $row, + 'item_num' => 1 + )); + } + $this->_addItems($addItems2, $awardService, $propertyChgService); + } + private function _addFreeItem(){ $chipMeta = \mt\Item::getMetaListByType(\mt\Item::CHIP_TYPE); foreach ($chipMeta as $row){