This commit is contained in:
slawkens 2020-07-07 00:53:56 +02:00
parent dc536f0fc0
commit fcff820858

View File

@ -144,7 +144,19 @@ if(isset($_POST['town']) && isset($_POST['state']) && isset($_POST['order']) &&
$type = 'all';
if (!empty($type) && $type != 'all')
$whereby .= ' AND `guild` ' . ($type == 'guildhalls' ? '!' : '') . '= 0';
{
$guildColumn = '';
if ($db->hasColumn('houses', 'guild')) {
$guildColumn = 'guild';
}
else if ($db->hasColumn('houses', 'guildid')) {
$guildColumn = 'guildid';
}
if($guildColumn !== '') {
$whereby .= ' AND `' . $guildColumn . '` ' . ($type == 'guildhalls' ? '!' : '') . '= 0';
}
}
$houses_info = $db->query('SELECT * FROM `houses` WHERE ' . $whereby. ' ORDER BY ' . $orderby);