왕조 일람에 아무것도 없을 때 '현재'가 안보이는 문제 해결

This commit is contained in:
2018-07-05 00:10:33 +09:00
parent 258d4b28da
commit 41f7ad8d75
+15 -10
View File
@@ -32,14 +32,18 @@ increaseRefresh("왕조일람", 1);
$showCurrentNation = true; $showCurrentNation = true;
foreach($db->query('SELECT * FROM emperior ORDER BY `no` DESC') as $emperior){ $emperiors = $db->query('SELECT * FROM emperior ORDER BY `no` DESC');
$serverID = $emperior['server_id']??($emperior['serverID']??null);
if($showCurrentNation && $serverID == UniqueConst::$serverID){ if($emperiors){
$serverID = $emperior[0]['server_id']??($emperior[0]['serverID']??null);
if($serverID == UniqueConst::$serverID){
$showCurrentNation = false; $showCurrentNation = false;
} }
if ($showCurrentNation) { }
$gameStor = KVStorage::getStorage($db, 'game_env');
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']); if ($showCurrentNation) {
$gameStor = KVStorage::getStorage($db, 'game_env');
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
?> ?>
<table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'> <table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'>
@@ -55,9 +59,10 @@ foreach($db->query('SELECT * FROM emperior ORDER BY `no` DESC') as $emperior){
</table> </table>
<?php <?php
$showCurrentNation = false; }
continue;
} foreach($emperiors as $emperior){
$serverID = $emperior['server_id']??($emperior['serverID']??null);
?> ?>
<table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'> <table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'>
@@ -102,7 +107,7 @@ foreach($db->query('SELECT * FROM emperior ORDER BY `no` DESC') as $emperior){
<?php <?php
} }
?> ?>
<table style="margin-top:10px;" align=center width=1000 class='tb_layout bg0'> <table style="margin-top:10px;" align=center width=1000 class='tb_layout bg0'>