Merge Branch 1.3 - Database correction
This commit is contained in:
commit
d3650ca8fc
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_CiblageEnrichissementIdentifiants extends Zend_Db_Table_Abstract
|
||||
{
|
||||
public $_name = 'enrichissement_identifiants';
|
||||
protected $_name = 'enrichissement_identifiants';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
@ -36,7 +36,7 @@ profil.db.metier.adapter=mysqli
|
||||
profil.db.metier.params.host=192.168.3.30
|
||||
profil.db.metier.params.username=ciblage
|
||||
profil.db.metier.params.password=z7jq8AhvrwqQJ4Yb
|
||||
profil.db.metier.params.dbname=jo
|
||||
profil.db.metier.params.dbname=ciblage
|
||||
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
|
||||
|
||||
profil.sphinx.host=127.0.0.1
|
||||
|
@ -36,7 +36,7 @@ profil.db.metier.adapter=mysqli
|
||||
profil.db.metier.params.host=192.168.78.230
|
||||
profil.db.metier.params.username=ciblage
|
||||
profil.db.metier.params.password=z7jq8AhvrwqQJ4Yb
|
||||
profil.db.metier.params.dbname=jo
|
||||
profil.db.metier.params.dbname=ciblage
|
||||
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
|
||||
|
||||
profil.sphinx.host=192.168.78.252
|
||||
|
@ -36,7 +36,7 @@ profil.db.metier.adapter=mysqli
|
||||
profil.db.metier.params.host=192.168.78.230
|
||||
profil.db.metier.params.username=ciblage
|
||||
profil.db.metier.params.password=z7jq8AhvrwqQJ4Yb
|
||||
profil.db.metier.params.dbname=jo
|
||||
profil.db.metier.params.dbname=ciblage
|
||||
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
|
||||
|
||||
profil.sphinx.host=192.168.78.252
|
||||
|
@ -44,6 +44,7 @@ if(isset($opts->help))
|
||||
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
Zend_Db_Table::setDefaultAdapter($db);
|
||||
|
||||
$commandesM = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
|
||||
|
@ -57,6 +57,7 @@ Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
|
||||
//Définition bdd
|
||||
try {
|
||||
$db = Zend_Db::factory($config->profil->db->metier);
|
||||
Zend_Db_Table::setDefaultAdapter($db);
|
||||
} catch ( Exception $e ) {
|
||||
exit ( $e->getMessage() );
|
||||
}
|
||||
@ -103,7 +104,7 @@ $fields = $dico->getFields();
|
||||
$tabEntete = array('siren', 'nic');
|
||||
$tabEnteteLabel = array('SIREN', 'NIC');
|
||||
$sql = 'SELECT LPAD(siren, 9, 000000000) AS siren, LPAD(nic,5,00000) AS nic,';
|
||||
$from = 'etablissements_act';
|
||||
$from = 'jo.etablissements_act';
|
||||
$addWhere = '';
|
||||
foreach ( $dataProfil as $item ) {
|
||||
//Définition de l'entete
|
||||
@ -159,9 +160,9 @@ $traite = 0;
|
||||
$dateStart = date('YmdHms');
|
||||
foreach ($identifiants as $siret )
|
||||
{
|
||||
$sql = $model.' FROM etablissements_act WHERE siren='.substr($siret,0,9).' AND nic='.substr($siret,9,5);
|
||||
$sql = $model.' FROM jo.etablissements_act WHERE siren='.substr($siret,0,9).' AND nic='.substr($siret,9,5);
|
||||
try {
|
||||
$result = $dbMetier->fetchAll($sql);
|
||||
$result = $db->fetchAll($sql);
|
||||
$traite++;
|
||||
} catch(Exception $e) {
|
||||
echo $sql;
|
||||
|
Loading…
Reference in New Issue
Block a user