From cceb61982f959c865ba91dce6918abfb022e9b2e Mon Sep 17 00:00:00 2001 From: hujiabin Date: Thu, 24 Nov 2022 14:18:34 +0800 Subject: [PATCH] 1 --- doc/Battle.py | 14 ++++++++++++ webapp/controller/BattleController.class.php | 22 ++++++++++++++++++- .../EventRankingController.class.php | 11 +++++----- webapp/models/BattleSettlement.php | 2 +- 4 files changed, 42 insertions(+), 7 deletions(-) diff --git a/doc/Battle.py b/doc/Battle.py index c0815648..bc1c37fc 100644 --- a/doc/Battle.py +++ b/doc/Battle.py @@ -33,6 +33,20 @@ class Battle(object): _common.RspHead(), ['!data', [_common.BattleHistory()], '战绩数据'], ] + },{ + 'method': 'GET', + 'name': 'showBattleHistory', + 'desc': '战绩详情', + 'group': 'Battle', + 'url': 'webapp/index.php?c=Battle&a=showBattleHistory', + 'params': [ + _common.ReqHead(), + ['battle_uniid', '', ' 战斗唯一id'] + ], + 'response': [ + _common.RspHead(), + ['info', [], '战绩详情'], + ] }, ] self.internalApis = [ diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index e94a2e65..1bf65c3e 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -246,7 +246,7 @@ class BattleController extends BaseAuthedController { myself()->_rspData($data); } - public function getBattleHistory(){ + public function getBattleHistory(){$this->showBattleHistory();die; $mode = getReqVal('mode', 0); $historyList = BattleHistory::orderBy(BattleHistory::getMyBattleHistoryByMode($mode),'desc'); $data = array(); @@ -260,6 +260,26 @@ class BattleController extends BaseAuthedController { )); } + public function showBattleHistory(){ + $battleUnid = getReqVal('battle_uniid', 0); + if ( !$battleUnid){ + $this->_rspErr(1,'param error'); + return; + } + $row = BattleSettlement::find($battleUnid); + if (!$row){ + $this->_rspErr(1,'param error'); + return; + } + $data = $row; + $data['data'] = json_decode($row['data'],true); + $this->_rspData( + array( + 'info'=>$data + ) + ); + } + public function decReviveCoin() { $num = getReqVal('num', 1); diff --git a/webapp/controller/EventRankingController.class.php b/webapp/controller/EventRankingController.class.php index 499f727c..ce30bf4d 100644 --- a/webapp/controller/EventRankingController.class.php +++ b/webapp/controller/EventRankingController.class.php @@ -251,10 +251,11 @@ class EventRankingController extends BaseAuthedController } public function settlementRankingAward(){ - $currentRankingMeta = mt\EventRanking::getCurrentRanking(); - $awardList = array(); - if ($currentRankingMeta){ - $lastRankingMeta = mt\EventRanking::find($currentRankingMeta['id']-1); + $id = getReqVal('id', 0); +// $currentRankingMeta = mt\EventRanking::getCurrentRanking(); +// $awardList = array(); +// if ($currentRankingMeta){ + $lastRankingMeta = mt\EventRanking::find($id); if ($lastRankingMeta){ switch ($lastRankingMeta['themeType']){ case \services\RankActivityService::KILLS_TYPE : { @@ -436,7 +437,7 @@ class EventRankingController extends BaseAuthedController } } } - } +// } } diff --git a/webapp/models/BattleSettlement.php b/webapp/models/BattleSettlement.php index 62ee67c5..697a6a90 100644 --- a/webapp/models/BattleSettlement.php +++ b/webapp/models/BattleSettlement.php @@ -30,7 +30,7 @@ class BattleSettlement extends BaseModel public static function find($battleUuid) { - $row = SqlHelper::selectOne + $row = SqlHelper::ormSelectOne (myself()->_getSelfMysql(), 't_battle_settlement', array(