From d4b5f0260369eb20dcadf05c98f864ed952f3c18 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 5 Jan 2022 13:41:11 +0800 Subject: [PATCH] 1 --- webapp/controller/HeroController.class.php | 32 +++++++++++++++++ webapp/mt/HeroLevel.php | 41 ++++++++++++++++++++++ webapp/mt/HeroQuality.php | 41 ++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 webapp/mt/HeroLevel.php create mode 100644 webapp/mt/HeroQuality.php diff --git a/webapp/controller/HeroController.class.php b/webapp/controller/HeroController.class.php index c7482cf6..85a68ca2 100644 --- a/webapp/controller/HeroController.class.php +++ b/webapp/controller/HeroController.class.php @@ -84,4 +84,36 @@ class HeroController extends BaseAuthedController { $this->_rspOk(); } + public function upgradeLevel() + { + $heroUniId = getReqVal('hero_uniid', 0); + $heroDb = Hero::find($heroUniId); + if (!$heroDb) { + $this->_rspErr(1, '英雄不存在'); + return; + } + if ($heroDb['state'] == Hero::GETED_STATE) { + $this->_rspErr(3, '试用英雄不能操作'); + return; + } + if ($heroDb['unlock_time'] > $this->_getNowTime()) { + $this->_rspErr(2, '锁定期间不能操作'); + return; + } + if ($heroDb['unlock_trade_time'] > $this->_getNowTime()) { + $this->_rspErr(2, '锁定期间不能操作'); + return; + } + $heroMeta = mt\Hero::get($heroDb['hero_id']); + if (!$heroMeta) { + $this->_rspErr(100, '服务器内部错误'); + return; + } + } + + public function upgradeQuality() + { + $heroUniId = getReqVal('hero_uniid', 0); + } + } diff --git a/webapp/mt/HeroLevel.php b/webapp/mt/HeroLevel.php new file mode 100644 index 00000000..1bd5806e --- /dev/null +++ b/webapp/mt/HeroLevel.php @@ -0,0 +1,41 @@ +