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;
}
//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
($this->_getSelfMysql(),
't_user',
@ -261,32 +291,7 @@ class UserController extends BaseAuthedController {
),
array(
),
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(),
)
$fields
);
$awardService = new services\AwardService();
$propertyChgService = new services\PropertyChgService();
@ -821,33 +826,38 @@ class UserController extends BaseAuthedController {
private function createNewUserV2($userName){
$currSeasonMeta = mt\RankSeason::getCurrentSeason();
SqlHelper::upsert
($this->_getSelfMysql(),
't_user',
array(
'account_id' => $this->_getAccountId()
),
array(
),
array(
'account_id' => $this->_getAccountId(),
'channel' => $this->_getChannel(),
'name' => $userName,
'sex' => rand() % 2,
'gold' => 0,
'diamond' => 0,
'level' => 1,
'rank' => 0,
'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(),
)
$fields = array(
'account_id' => $this->_getAccountId(),
'channel' => $this->_getChannel(),
'name' => $userName,
'sex' => rand() % 2,
'gold' => 0,
'diamond' => 0,
'level' => 1,
'rank' => 0,
'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){