(cherry picked from commit fcff820858dca3e8d2692e9bfee27ea89c8b9727)
This commit is contained in:
slawkens 2020-07-07 00:53:56 +02:00
parent 722264a083
commit de1d6b9629

View File

@ -143,8 +143,20 @@ if(isset($_POST['town']) && isset($_POST['state']) && isset($_POST['order']) &&
if($type == 'guildhalls' && !$db->hasColumn('houses', 'guild'))
$type = 'all';
if(!empty($type) && $type != 'all')
$whereby .= ' AND `guild` ' . ($type == 'guildhalls' ? '!' : '') . '= 0';
if (!empty($type) && $type != 'all')
{
$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);