mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Fix highscores error
This commit is contained in:
parent
9d119b6279
commit
a04fbde607
@ -135,6 +135,7 @@ if($settingHighscoresOutfit) {
|
||||
$configHighscoresPerPage = setting('core.highscores_per_page');
|
||||
$limit = $configHighscoresPerPage + 1;
|
||||
|
||||
$highscores = [];
|
||||
$needReCache = true;
|
||||
$cacheKey = 'highscores_' . $skill . '_' . $vocation . '_' . $page . '_' . $configHighscoresPerPage;
|
||||
|
||||
@ -158,7 +159,7 @@ $query->join('accounts', 'accounts.id', '=', 'players.account_id')
|
||||
->selectRaw('accounts.country, players.id, players.name, players.account_id, players.level, players.vocation' . $outfit . $promotion)
|
||||
->orderByDesc('value');
|
||||
|
||||
if (!isset($highscores) || empty($highscores)) {
|
||||
if (empty($highscores)) {
|
||||
if ($skill >= POT::SKILL_FIRST && $skill <= POT::SKILL_LAST) { // skills
|
||||
if ($db->hasColumn('players', 'skill_fist')) {// tfs 1.0
|
||||
$skill_ids = array(
|
||||
@ -201,16 +202,16 @@ if (!isset($highscores) || empty($highscores)) {
|
||||
$list = 'experience';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$highscores = $query->get()->map(function($row) {
|
||||
$highscores = $query->get()->map(function($row) {
|
||||
$tmp = $row->toArray();
|
||||
$tmp['online'] = $row->online_status;
|
||||
$tmp['vocation'] = $row->vocation_name;
|
||||
unset($tmp['online_table']);
|
||||
|
||||
return $tmp;
|
||||
})->toArray();
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
if ($cache->enabled() && $needReCache) {
|
||||
$cache->set($cacheKey, serialize($highscores), setting('core.highscores_cache_ttl') * 60);
|
||||
|
Loading…
x
Reference in New Issue
Block a user