Commit 1cd0d50cb2bcbcb08e9df43c464b7c0ce5cb56ba

Authored by Edmar Moretti
1 parent 1b07840e

Correção na seleção por atributos numéricos

Showing 1 changed file with 6 additions and 1 deletions   Show diff stats
classesphp/classe_selecao.php
@@ -337,7 +337,12 @@ $valor - Valor. @@ -337,7 +337,12 @@ $valor - Valor.
337 if($this->layer->connectiontype == MS_POSTGIS) 337 if($this->layer->connectiontype == MS_POSTGIS)
338 {$this->layer->querybyattributes($item,$item." ".$operador." '".$valor."' ",1);} 338 {$this->layer->querybyattributes($item,$item." ".$operador." '".$valor."' ",1);}
339 else 339 else
340 - {$this->layer->querybyattributes($item,'("['.$item.']"'.$operador.'"'.$valor.'")',1);} 340 + {
  341 + if(!is_numeric($valor))
  342 + {$this->layer->querybyattributes($item,'("['.$item.']"'.$operador.'"'.$valor.'")',1);}
  343 + else
  344 + {$this->layer->querybyattributes($item,'(['.$item.']'.$operador.' '.$valor.' )',1);}
  345 + }
341 $res_count = $this->layer->getNumresults(); 346 $res_count = $this->layer->getNumresults();
342 $shpi = array(); 347 $shpi = array();
343 for ($i = 0; $i < $res_count; ++$i) 348 for ($i = 0; $i < $res_count; ++$i)