From 3c0f258fb046033d71d984df2d77df6aea5a0197 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 7 Dec 2021 14:36:22 +0800 Subject: [PATCH] 1 --- webapp/controller/UserController.class.php | 18 +++++++++--------- webapp/models/User.php | 2 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index fea525b..84020fa 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -49,6 +49,14 @@ class UserController extends BaseAuthedController { { $initRankMeta = mt\Rank::getInitRank(); $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 ($this->_getSelfMysql(), 't_user', @@ -60,7 +68,7 @@ class UserController extends BaseAuthedController { array( 'account_id' => $this->_getAccountId(), 'name' => $userName, - 'sex' => 2, + 'sex' => rand() % 2, #'avatar_url' => $avatar_url, 'gold' => 10000 * 10000, 'diamond' => 10000 * 10000, @@ -78,14 +86,6 @@ class UserController extends BaseAuthedController { '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( array( diff --git a/webapp/models/User.php b/webapp/models/User.php index eb3e1dd..8525cd8 100644 --- a/webapp/models/User.php +++ b/webapp/models/User.php @@ -15,6 +15,7 @@ class User extends BaseModel { 'head_frame' => $row['head_frame'], 'level' => $row['level'], 'exp' => $row['exp'], + 'max_exp' => $row['exp'] + 1000, 'rank' => $row['rank'], 'score' => $row['score'], 'gold' => $row['gold'], @@ -37,6 +38,7 @@ class User extends BaseModel { 'head_frame' => $row['head_frame'], 'level' => $row['level'], 'exp' => $row['exp'], + 'max_exp' => $row['exp'] + 1000, 'rank' => $row['rank'], 'score' => $row['score'], 'gold' => $row['gold'],