mirror of
https://github.com/slawkens/myaac.git
synced 2025-11-28 06:06:51 +01:00
Fix #318 (online.php throws error in one scenario)
This commit is contained in:
@@ -105,8 +105,17 @@ $cached = Cache::remember("online_$order", setting('core.online_cache_ttl') * 60
|
|||||||
$result = null;
|
$result = null;
|
||||||
$timestamp = false;
|
$timestamp = false;
|
||||||
if($db->hasTable('server_record')) {
|
if($db->hasTable('server_record')) {
|
||||||
$timestamp = true;
|
$timestamp = $db->hasColumn('server_record', 'timestamp');
|
||||||
$result = ServerRecord::where('world_id', configLua('worldId'))->orderByDesc('record')->first()->toArray();
|
$serverRecordQuery = ServerRecord::query();
|
||||||
|
|
||||||
|
if ($db->hasColumn('server_record', 'world_id')) {
|
||||||
|
$serverRecordQuery->where('world_id', configLua('worldId'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $serverRecordQuery->orderByDesc('record')->first();
|
||||||
|
if ($result) {
|
||||||
|
$result = $result->toArray();
|
||||||
|
}
|
||||||
} else if($db->hasTable('server_config')) { // tfs 1.0
|
} else if($db->hasTable('server_config')) { // tfs 1.0
|
||||||
$row = ServerConfig::where('config', 'players_record')->first();
|
$row = ServerConfig::where('config', 'players_record')->first();
|
||||||
if ($row) {
|
if ($row) {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% if setting('core.online_record') %}
|
{% if setting('core.online_record') and record|length > 0 %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="LabelV150"><b>Online Record:</b></td>
|
<td class="LabelV150"><b>Online Record:</b></td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user