game2006api/webapp/controller/BattleHistoryController.class.php
hujiabin 30241e3cb1 1
2024-04-22 15:16:49 +08:00

31 lines
857 B
PHP

<?php
require_once('models/BattleSettlement.php');
require_once('models/BattleHistory.php');
use models\BattleSettlement;
use models\BattleHistory;
class BattleHistoryController extends BaseAuthedController {
public function getBattleList(){
$accountId = getReqVal('target_id', 0);
$room_mode = getReqVal('room_mode', 0);
if (!$accountId){
$accountId = myself()->_getAccountId();
}
$singleList = BattleSettlement::getSingleList($accountId,$room_mode);
$historyList = BattleHistory::orderBy($singleList,'desc');
$data = array();
foreach ($historyList as $k=>$history){
if ($k < 40){
array_push($data,$history);
}
}
$this->_rspData(array(
'data' => $data
));
}
}