This commit is contained in:
aozhiwei 2021-12-07 14:36:22 +08:00
parent cd74a62a21
commit 3c0f258fb0
2 changed files with 11 additions and 9 deletions

View File

@ -49,6 +49,14 @@ class UserController extends BaseAuthedController {
{ {
$initRankMeta = mt\Rank::getInitRank(); $initRankMeta = mt\Rank::getInitRank();
$currSeasonMeta = mt\Season::getCurrentSeason(); $currSeasonMeta = mt\Season::getCurrentSeason();
{
foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) {
$heroMeta = mt\Hero::get($heroId);
if ($heroMeta) {
Hero::addHero($heroMeta);
}
}
}
SqlHelper::upsert SqlHelper::upsert
($this->_getSelfMysql(), ($this->_getSelfMysql(),
't_user', 't_user',
@ -60,7 +68,7 @@ class UserController extends BaseAuthedController {
array( array(
'account_id' => $this->_getAccountId(), 'account_id' => $this->_getAccountId(),
'name' => $userName, 'name' => $userName,
'sex' => 2, 'sex' => rand() % 2,
#'avatar_url' => $avatar_url, #'avatar_url' => $avatar_url,
'gold' => 10000 * 10000, 'gold' => 10000 * 10000,
'diamond' => 10000 * 10000, 'diamond' => 10000 * 10000,
@ -78,14 +86,6 @@ class UserController extends BaseAuthedController {
'modifytime' => $this->_getNowTime(), 'modifytime' => $this->_getNowTime(),
) )
); );
{
foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) {
$heroMeta = mt\Hero::get($heroId);
if ($heroMeta) {
Hero::addHero($heroMeta);
}
}
}
{ {
$this->_addItems(array( $this->_addItems(array(
array( array(

View File

@ -15,6 +15,7 @@ class User extends BaseModel {
'head_frame' => $row['head_frame'], 'head_frame' => $row['head_frame'],
'level' => $row['level'], 'level' => $row['level'],
'exp' => $row['exp'], 'exp' => $row['exp'],
'max_exp' => $row['exp'] + 1000,
'rank' => $row['rank'], 'rank' => $row['rank'],
'score' => $row['score'], 'score' => $row['score'],
'gold' => $row['gold'], 'gold' => $row['gold'],
@ -37,6 +38,7 @@ class User extends BaseModel {
'head_frame' => $row['head_frame'], 'head_frame' => $row['head_frame'],
'level' => $row['level'], 'level' => $row['level'],
'exp' => $row['exp'], 'exp' => $row['exp'],
'max_exp' => $row['exp'] + 1000,
'rank' => $row['rank'], 'rank' => $row['rank'],
'score' => $row['score'], 'score' => $row['score'],
'gold' => $row['gold'], 'gold' => $row['gold'],