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