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