diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 7b185fb6..52ba5b9e 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -373,9 +373,13 @@ class BattleController extends BaseAuthedController { } public function getBattleHistory(){ + $accountId = getReqVal('target_id', 0); $room_mode = getReqVal('room_mode', 0); $pvp_mode = getReqVal('pvp_mode', 0); - $singleList = BattleSettlement::getSingleList($room_mode,$pvp_mode); + if (!$accountId){ + $accountId = myself()->_getAccountId(); + } + $singleList = BattleSettlement::getSingleList($accountId,$room_mode,$pvp_mode); $historyList = BattleHistory::orderBy($singleList,'desc'); // print_r($data);die; // $historyList = BattleHistory::orderBy(BattleHistory::getMyBattleHistoryByMode($mode),'desc'); diff --git a/webapp/models/BattleSettlement.php b/webapp/models/BattleSettlement.php index ae5e9598..1538db91 100644 --- a/webapp/models/BattleSettlement.php +++ b/webapp/models/BattleSettlement.php @@ -68,13 +68,13 @@ class BattleSettlement extends BaseModel ); } - public static function getSingleList($roomMode, $matchMode) + public static function getSingleList($accountId,$roomMode, $matchMode) { $rows = SqlHelper::ormSelect (myself()->_getSelfMysql(), 't_battle_settlement_single', array( - 'account_id' => myself()->_getAccountId(), + 'account_id' => $accountId, ) ); $pvpMatchList = array();