1
This commit is contained in:
parent
4d0b73ff0d
commit
19b7b31865
@ -162,17 +162,15 @@ class BattleController extends BaseAuthedController {
|
||||
|
||||
public function getBattleHistory(){
|
||||
$mode = getReqVal('mode', 0);
|
||||
$historyList = BattleHistory::getMyBattleHistory();
|
||||
$historyList = BattleHistory::orderBy(BattleHistory::getMyBattleHistoryByMode($mode),'desc');
|
||||
$data = array();
|
||||
foreach ($historyList as $history){
|
||||
if ($history['match_mode'] == $mode){
|
||||
foreach ($historyList as $k=>$history){
|
||||
if ($k < 20){
|
||||
array_push($data,BattleHistory::toDto($history));
|
||||
}
|
||||
}
|
||||
$list = BattleHistory::orderBy($data,'desc');
|
||||
$this->_rspData(array(
|
||||
'data' => $list
|
||||
'data' => $data
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -21,13 +21,14 @@ class BattleHistory extends BaseModel
|
||||
);
|
||||
}
|
||||
|
||||
public static function getMyBattleHistory()
|
||||
public static function getMyBattleHistoryByMode($mode)
|
||||
{
|
||||
$row = SqlHelper::ormSelect(
|
||||
myself()->_getSelfMysql(),
|
||||
't_battle_history',
|
||||
array(
|
||||
'account_id' => myself()->_getAccountId(),
|
||||
'match_mode' => $mode,
|
||||
)
|
||||
);
|
||||
return $row;
|
||||
|
Loading…
x
Reference in New Issue
Block a user