From 3489adc7b9122caf39c1dc68cec6d7e4bc5abf7b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 7 Dec 2021 16:45:08 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 1 - webapp/controller/UserController.class.php | 6 +++--- webapp/models/Hero.php | 3 +-- webapp/models/User.php | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index b756319..5397868 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -73,7 +73,6 @@ CREATE TABLE `t_user` ( `ride_car_kills` bigint NOT NULL DEFAULT '0' COMMENT '驾驶或乘坐载具累计击杀X个敌人', `to_teammate_like_times` bigint NOT NULL DEFAULT '0' COMMENT '给队友点赞次数', `consume_gold` bigint NOT NULL DEFAULT '0' COMMENT '消费金币数', - `max_alive_time` bigint NOT NULL DEFAULT '0' COMMENT '最高存活时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 1ba9e0f..b8d1536 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -58,7 +58,7 @@ class UserController extends BaseAuthedController { $addItems = array(); { foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) { - $heroMeta = mt\Hero::get($heroId); + $heroMeta = mt\Item::get($heroId); if ($heroMeta) { Hero::addHero($heroMeta); array_push($heroList, $heroMeta); @@ -70,7 +70,7 @@ class UserController extends BaseAuthedController { } { foreach (mt\Parameter::getListValue('creator_present_items') as $itemsStr) { - list($itemId, $itemNum) = explode(':', $itemStr); + list($itemId, $itemNum) = explode(':', $itemsStr); if ($itemNum > 0) { switch ($itemId) { case V_ITEM_GOLD: @@ -116,7 +116,7 @@ class UserController extends BaseAuthedController { $headId = !empty($headList) ? $headList[rand() % count($headList)] : 0; $headFrame = !empty($headFrameList) ? $headFrameList[rand() % count($headFrameList)] : 0; $heroId = !empty($heroList) ? $heroList[rand() % count($heroList)]['id'] : 0; - if ($headId == 0) { + if ($headId == 0 || count($headList) <= 1) { $headId = !empty($haveHeadHeroList) ? $haveHeadHeroList[rand() % count($haveHeadHeroList)]['hero_head'] : 0; } diff --git a/webapp/models/Hero.php b/webapp/models/Hero.php index e5fc6e2..41f4f07 100644 --- a/webapp/models/Hero.php +++ b/webapp/models/Hero.php @@ -38,7 +38,6 @@ class Hero extends BaseModel { public static function addHero($heroMeta) { - $defSkin = mt\Hero::getDefaultSkin($heroMeta); SqlHelper::upsert( myself()->_getSelfMysql(), 't_hero', @@ -52,7 +51,7 @@ class Hero extends BaseModel { 'account_id' => myself()->_getAccountId(), 'hero_id' => $heroMeta['id'], 'hero_lv' => 1, - 'skin_id' => $defSkin, + #'skin_id' => $defSkin, 'skill_lv1' => 1, 'skill_lv2' => 1, 'yoke_lv' => 0, diff --git a/webapp/models/User.php b/webapp/models/User.php index e0a8f9e..35097f4 100644 --- a/webapp/models/User.php +++ b/webapp/models/User.php @@ -16,7 +16,7 @@ class User extends BaseModel { 'account_id' => $row['account_id'], 'name' => $row['name'], 'sex' => $row['sex'], - 'head_id' => $row['hero_id'], + 'head_id' => $row['head_id'], 'head_frame' => $row['head_frame'], 'level' => $row['level'], 'exp' => $row['exp'], @@ -39,7 +39,7 @@ class User extends BaseModel { 'account_id' => $row['account_id'], 'name' => $row['name'], 'sex' => $row['sex'], - 'head_id' => $row['hero_id'], + 'head_id' => $row['head_id'], 'head_frame' => $row['head_frame'], 'level' => $row['level'], 'exp' => $row['exp'],