1
This commit is contained in:
parent
be4e106e10
commit
916710ca48
@ -174,7 +174,33 @@ class CircuitRankingService extends BaseService {
|
|||||||
|
|
||||||
public static function recalcRanking()
|
public static function recalcRanking()
|
||||||
{
|
{
|
||||||
|
$currentStageMeta = mt\CircuitTime::getCurrentStage();
|
||||||
|
if (empty($currentStageMeta)) {
|
||||||
|
myself()->_rspErr(1, 'currentStageMeta Is empty');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$rows = SqlHelper::ormSelect
|
||||||
|
($this->_getMysql(''),
|
||||||
|
't_circuit_battle_phase',
|
||||||
|
array(
|
||||||
|
'season' => $currentStageMeta['circuit_season'],
|
||||||
|
'phase' => $currentStageMeta['circuit_phase'],
|
||||||
|
'is_android' => 0,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$data = array();
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
if ($row['cumulative_scor'] > 0) {
|
||||||
|
array_push($data, $row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$sortRows = myself()->arraySort($data, 'cumulative_score', 'desc');
|
||||||
|
if (count($sortRows) <= 20) {
|
||||||
|
myself()->_rspErr(1, '人数不足20');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//21-100 之间的名次 塞入35名
|
||||||
|
//101-200之间的名次 塞入 40名
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user