The question is as follows, in mysql we can concatenate a query and then perform the search, as follows:
$cidades = '&& (cidade = 100 || cidade = 101 || cidade = 102)';
$order = 'id ASC';
$sql = 'SELECT * FROM tabela WHERE status = 1 '.$cidades.' ORDER BY '.$order;
The variable $cidade
can be empty or have n search elements, I can not do this, I do not know if it would be this way:
$sql = $this->_db->prepare('SELECT * FROM tabela WHERE status = 1 :cidades ORDER BY :order');
$sql->execute(array(':cidades' => $cidades, ':order' => $order));