31 lines
857 B
PHP
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
|
|
));
|
|
}
|
|
|
|
}
|