This commit is contained in:
hujiabin 2022-11-23 17:10:08 +08:00
parent ae94dadc55
commit e03943a642

View File

@ -45,6 +45,7 @@ class UserController extends BaseAuthedController {
$userInfo = $this->_safeGetOrmUserInfo();
if (!$userInfo) {
$this->createNewUserV2($userName);
$this->_addFreeItem(); //送 50 Test_CEG
$userInfo = $this->_getOrmUserInfo();
$this->_setV(TN_RANK_STATUS, 0, 1);
}
@ -124,27 +125,33 @@ class UserController extends BaseAuthedController {
}
private function _addFreeItem(){
foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) {
$heroMeta = mt\Item::get($heroId);
if ($heroMeta) {
Hero::addHero($heroMeta);
User::upsertHeadList($heroMeta);
}
}
$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
));
}
}
// foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) {
// $heroMeta = mt\Item::get($heroId);
// if ($heroMeta) {
// Hero::addHero($heroMeta);
// User::upsertHeadList($heroMeta);
// }
// }
// $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
// ));
// }
// }
$items = array(
array(
'item_id' => V_ITEM_GOLD,
'item_num' => 50
)
);
$awardService = new services\AwardService();
$propertyChgService = new services\PropertyChgService();
$this->_addItems($addItems, $awardService, $propertyChgService);
$this->_addItems($items, $awardService, $propertyChgService);
}
private function loginCheck($userInfo)