This commit is contained in:
aozhiwei 2023-06-05 20:04:10 +08:00
parent 155258c96f
commit 6d5ff76434

View File

@ -253,6 +253,36 @@ class UserController extends BaseAuthedController {
$haveHeadHeroList[rand() % count($haveHeadHeroList)]['hero_head'] : 0; $haveHeadHeroList[rand() % count($haveHeadHeroList)]['hero_head'] : 0;
} }
//Hero::randHero($heroUniId, $heroId); //Hero::randHero($heroUniId, $heroId);
$fields = array(
'account_id' => $this->_getAccountId(),
'channel' => $this->_getChannel(),
'name' => $userName,
'sex' => rand() % 2,
#'avatar_url' => $avatar_url,
'gold' => $gold,
'diamond' => $diamond,
'head_frame' => $headFrame,
'level' => 1,
'exp' => 0,
'rank' => $initRankMeta ? $initRankMeta['id'] : 1,
'history_best_rank' => $initRankMeta ? $initRankMeta['id'] : 1,
'score' => $initRankMeta ? $initRankMeta['rank_score'] : 0,
'history_best_score' => $initRankMeta ? $initRankMeta['rank_score'] : 0,
'head_id' => $headId,
'hero_id' => $heroId,
'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0,
'head_list' => json_encode($headList),
'head_frame_list' => json_encode($headFrameList),
'score_modifytime' => $this->_getNowTime(),
'best_rank_modifytime' => $this->_getNowTime(),
'createtime' => $this->_getNowTime(),
'modifytime' => $this->_getNowTime(),
'last_login_time' => $this->_getNowTime(),
);
if ($this->_getChannel() == BC_CHANNEL) {
$fields['address'] = $this->_getOpenId();
}
SqlHelper::upsert SqlHelper::upsert
($this->_getSelfMysql(), ($this->_getSelfMysql(),
't_user', 't_user',
@ -261,32 +291,7 @@ class UserController extends BaseAuthedController {
), ),
array( array(
), ),
array( $fields
'account_id' => $this->_getAccountId(),
'channel' => $this->_getChannel(),
'name' => $userName,
'sex' => rand() % 2,
#'avatar_url' => $avatar_url,
'gold' => $gold,
'diamond' => $diamond,
'head_frame' => $headFrame,
'level' => 1,
'exp' => 0,
'rank' => $initRankMeta ? $initRankMeta['id'] : 1,
'history_best_rank' => $initRankMeta ? $initRankMeta['id'] : 1,
'score' => $initRankMeta ? $initRankMeta['rank_score'] : 0,
'history_best_score' => $initRankMeta ? $initRankMeta['rank_score'] : 0,
'head_id' => $headId,
'hero_id' => $heroId,
'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0,
'head_list' => json_encode($headList),
'head_frame_list' => json_encode($headFrameList),
'score_modifytime' => $this->_getNowTime(),
'best_rank_modifytime' => $this->_getNowTime(),
'createtime' => $this->_getNowTime(),
'modifytime' => $this->_getNowTime(),
'last_login_time' => $this->_getNowTime(),
)
); );
$awardService = new services\AwardService(); $awardService = new services\AwardService();
$propertyChgService = new services\PropertyChgService(); $propertyChgService = new services\PropertyChgService();
@ -821,33 +826,38 @@ class UserController extends BaseAuthedController {
private function createNewUserV2($userName){ private function createNewUserV2($userName){
$currSeasonMeta = mt\RankSeason::getCurrentSeason(); $currSeasonMeta = mt\RankSeason::getCurrentSeason();
SqlHelper::upsert $fields = array(
($this->_getSelfMysql(), 'account_id' => $this->_getAccountId(),
't_user', 'channel' => $this->_getChannel(),
array( 'name' => $userName,
'account_id' => $this->_getAccountId() 'sex' => rand() % 2,
), 'gold' => 0,
array( 'diamond' => 0,
), 'level' => 1,
array( 'rank' => 0,
'account_id' => $this->_getAccountId(), 'score' => 0,
'channel' => $this->_getChannel(), 'exp' => 0,
'name' => $userName, 'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0,
'sex' => rand() % 2, 'score_modifytime' => $this->_getNowTime(),
'gold' => 0, 'best_rank_modifytime' => $this->_getNowTime(),
'diamond' => 0, 'createtime' => $this->_getNowTime(),
'level' => 1, 'modifytime' => $this->_getNowTime(),
'rank' => 0, 'last_login_time' => $this->_getNowTime(),
'score' => 0,
'exp' => 0,
'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0,
'score_modifytime' => $this->_getNowTime(),
'best_rank_modifytime' => $this->_getNowTime(),
'createtime' => $this->_getNowTime(),
'modifytime' => $this->_getNowTime(),
'last_login_time' => $this->_getNowTime(),
)
); );
if ($this->_getChannel() == BC_CHANNEL) {
$fields['address'] = $this->_getOpenId();
}
SqlHelper::upsert
($this->_getSelfMysql(),
't_user',
array(
'account_id' => $this->_getAccountId()
),
array(
),
$fields
);
} }
private function updateLastSeason($userInfo){ private function updateLastSeason($userInfo){