1
This commit is contained in:
parent
424acd4b6d
commit
377dd51fa8
@ -209,6 +209,14 @@ class CircuitRankingService extends BaseService {
|
||||
}
|
||||
}
|
||||
$sortRows = myself()->arraySort($data, 'cumulative_score', 'desc');
|
||||
{
|
||||
for ($i = 0; $i < 200; ++$i) {
|
||||
array_push($sortRows, array(
|
||||
'account_id' => $i,
|
||||
'cumulative_score' => 1000 - $i
|
||||
));
|
||||
}
|
||||
}
|
||||
if (count($sortRows) <= 20) {
|
||||
myself()->_rspErr(1, '人数不足20');
|
||||
return;
|
||||
@ -237,7 +245,7 @@ class CircuitRankingService extends BaseService {
|
||||
$rangeScore = $lastScore - $currScore;
|
||||
$allocScore = $currScore + rand(0, $rangeScore - 1);
|
||||
$curAndroid = $sortAndroids[$i];
|
||||
self::updateAndroid($curAndroid, $allocScore, $currentStageMeta);
|
||||
self::updateAndroidScore($curAndroid, $allocScore, $currentStageMeta);
|
||||
$lastScore = $currScore;
|
||||
}
|
||||
myself()->_rspOk();
|
||||
@ -248,22 +256,20 @@ class CircuitRankingService extends BaseService {
|
||||
if ($newScore <= $android['cumulative_score']) {
|
||||
return;
|
||||
}
|
||||
if ($curAndroid['cumulative_score'] <= 0) {
|
||||
if ($android['cumulative_score'] <= 0) {
|
||||
SqlHelper::upsert
|
||||
($this->_getMysql(''),
|
||||
(myself()->_getMysql(''),
|
||||
't_circuit_battle',
|
||||
array(
|
||||
'account_id' => $android['robot_id'],
|
||||
'account_id' => $android['account_id'],
|
||||
'season' => $currentStageMeta['circuit_season'],
|
||||
'phase' => $currentStageMeta['circuit_phase'],
|
||||
),
|
||||
array(
|
||||
'cumulative_score' => $newScore,
|
||||
),
|
||||
array(
|
||||
'account_id' => $android['robot_id'],
|
||||
'account_id' => $android['account_id'],
|
||||
'season' => $currentStageMeta['circuit_season'],
|
||||
'phase' => $currentStageMeta['circuit_phase'],
|
||||
'is_android' => 1,
|
||||
'cumulative_score' => $newScore,
|
||||
'createtime' => myself()->_getNowTime(),
|
||||
@ -272,12 +278,11 @@ class CircuitRankingService extends BaseService {
|
||||
);
|
||||
} else {
|
||||
SqlHelper::upsert
|
||||
($this->_getMysql(''),
|
||||
(myself()->_getMysql(''),
|
||||
't_circuit_battle',
|
||||
array(
|
||||
'account_id' => $android['robot_id'],
|
||||
'account_id' => $android['account_id'],
|
||||
'season' => $currentStageMeta['circuit_season'],
|
||||
'phase' => $currentStageMeta['circuit_phase'],
|
||||
),
|
||||
array(
|
||||
'cumulative_score' => function() use($android, $newScore) {
|
||||
@ -286,9 +291,8 @@ class CircuitRankingService extends BaseService {
|
||||
},
|
||||
),
|
||||
array(
|
||||
'account_id' => $android['robot_id'],
|
||||
'account_id' => $android['account_id'],
|
||||
'season' => $currentStageMeta['circuit_season'],
|
||||
'phase' => $currentStageMeta['circuit_phase'],
|
||||
'is_android' => 1,
|
||||
'cumulative_score' => $newScore,
|
||||
'createtime' => myself()->_getNowTime(),
|
||||
@ -297,10 +301,10 @@ class CircuitRankingService extends BaseService {
|
||||
);
|
||||
}
|
||||
SqlHelper::update
|
||||
($this->_getMysql(''),
|
||||
't_circuit_battle',
|
||||
(myself()->_getMysql(''),
|
||||
't_circuit_battle_phase',
|
||||
array(
|
||||
'account_id' => $android['robot_id'],
|
||||
'account_id' => $android['account_id'],
|
||||
'season' => $currentStageMeta['circuit_season'],
|
||||
'phase' => $currentStageMeta['circuit_phase'],
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user