correction domtom

This commit is contained in:
Damien LASSERRE 2012-02-17 09:33:09 +00:00
parent e235c8545b
commit 38bb1176ee
2 changed files with 12 additions and 6 deletions

View File

@ -12,16 +12,20 @@ Class Ciblage
public $nb_results = 5000;
public $max_results = 500000;
public $mysql_host = '192.168.78.230';
public $mysql_user = 'sphinx';
public $mysql_password = 'indexer';
public $mysql_database = 'jo';
public $sphinx_host = '192.168.78.252';
public $sphinx_port = 3312;
public $sphinx_match = SPH_MATCH_EXTENDED2;
public $sphinx_sort = SPH_SORT_EXTENDED;
public function __construct($structure, $need = false)
{
$configuration = Zend_Registry::get('configuration');
//Instantiation Sphinx
$this->sphinx = new SphinxClient();
$this->sphinx->SetServer($configuration->sphinx->host, intval($configuration->sphinx->port));
$this->sphinx->SetServer($this->sphinx_host, $this->sphinx_port);
$this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED2);
$this->sphinx->ResetFilters();
foreach($structure as $key => $valeur) {

View File

@ -686,7 +686,7 @@ Class Fields
protected function localisationArbo($name, $valeur)
{
if(strlen($valeur) == 3) {
if(strlen($valeur) <= 3) {
switch($valeur[0]) {
case 'R':
$table = new Table_Departements();
@ -696,12 +696,13 @@ Class Fields
->where('codeRegionInsee ='.substr($valeur, 1, strlen($valeur)))
->setIntegrityCheck(false);
$result = $table->fetchAll($sql)->toArray();
foreach ($result as $res) {
$return[] = $res['INSEE'];
}
break;
case 'D':
$table = new Table_Departements();
$table = new Table_Departements();
$sql = $table->select()
->from('departements')
->join(array('cp' => 'codepostaux'), 'cp.codepos LIKE CONCAT(departements.numdep, "%")', array('INSEE'))
@ -715,6 +716,7 @@ Class Fields
}
} else
return (array($valeur));
return ($return);
}