From e531cc603a33a9a3d923e615b7ceb6f0014a538b Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Tue, 23 Jan 2024 11:54:12 +0800 Subject: [PATCH] 1 --- doc/Battle.py | 14 ++++++++++++++ webapp/controller/BattleController.class.php | 13 ++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/doc/Battle.py b/doc/Battle.py index f0326325..706efabd 100644 --- a/doc/Battle.py +++ b/doc/Battle.py @@ -49,6 +49,20 @@ class Battle(object): _common.RspHead(), ['info', _common.BattleSettlement(), '战绩详情'], ] + },{ + 'method': 'GET', + 'name': 'personalReport', + 'desc': '个人战绩', + 'group': 'Battle', + 'url': 'webapp/index.php?c=Battle&a=personalReport', + 'params': [ + _common.ReqHead(), + ['room_mode', '', ' 房间模式'] + ], + 'response': [ + _common.RspHead(), + ['items', [], '战斗奖励'], + ] }, ] self.internalApis = [ diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index ae37570a..ad5e1bf9 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -138,19 +138,20 @@ class BattleController extends BaseAuthedController { switch ($status){ case \mt\ServerTask::ACCOMPLISH_MOBA_STATE :{ if ($mode == \services\TameBattleDataService::ROOM_MODE_PVP){ - $item = array( + array_push($item,array( "item_id" => 300001, "item_num" => 1, - ); + )); + } } break; case \mt\ServerTask::ACCOMPLISH_PVP_STATE : { if ($mode == \services\TameBattleDataService::ROOM_MODE_MOBA){ - $item = array( + array_push($item,array( "item_id" => 300001, "item_num" => 1, - ); + )); } } break; @@ -159,7 +160,9 @@ class BattleController extends BaseAuthedController { if ($item){ Bag::addItem($item['item_id'],$item['item_num']); } - $this->_rspData($item); + $this->_rspData(array( + "items" => $item + )); } public function teamReport()