Correction requete sql
This commit is contained in:
parent
1b7965fbd2
commit
398171e813
@ -12,6 +12,10 @@ class DashboardController extends Libs_Controller
|
||||
$object = new Object_Dashboard();
|
||||
|
||||
$this->view->comptages = $object->index();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function ciblagesAction()
|
||||
@ -75,35 +79,38 @@ class DashboardController extends Libs_Controller
|
||||
*/
|
||||
public function enrichissementsAction()
|
||||
{
|
||||
$enrichissementsM = new Table_EnrichissementCommandes();
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Criteres => Comptages (last) => enrichissement_identifiants => enrichissement_commandes
|
||||
$enrichissementsM = new Table_EnrichissementCommandes();
|
||||
|
||||
$sql = $enrichissementsM->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from(
|
||||
array('p'=> 'enrichissement_profils'),
|
||||
array('idClient', 'login')
|
||||
array('i' => 'enrichissement_identifiants'),
|
||||
array('reference')
|
||||
)
|
||||
->join(
|
||||
array('c'=> 'enrichissement_commandes'), 'p.id = c.idProfil ',
|
||||
->join( array('cmd' => 'enrichissement_commandes'), 'i.idCommande = cmd.id',
|
||||
array('id', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->where('c.dateStop = ?', 0);
|
||||
->join( array('c' => 'comptages'), 'i.idComptage = c.id',
|
||||
array('')
|
||||
)
|
||||
->join( array('criteres' => 'criteres'), 'c.idDefinition = criteres.id',
|
||||
array('')
|
||||
);
|
||||
|
||||
$sql->where('cmd.dateStop = ?', 0)
|
||||
->where('criteres.idClient = ?', $user->idClient)
|
||||
->where('criteres.login = ?', $user->username);
|
||||
|
||||
$encours = $enrichissementsM->fetchAll($sql);
|
||||
$this->view->assign('encours', $encours);
|
||||
|
||||
|
||||
$sql = $enrichissementsM->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from(
|
||||
array('p'=> 'enrichissement_profils'),
|
||||
array('idClient', 'login')
|
||||
)
|
||||
->join(
|
||||
array('c'=> 'enrichissement_commandes'), 'p.id = c.idProfil ',
|
||||
array('id', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->where('c.dateStop != ?', 0);
|
||||
|
||||
$sql->where('cmd.dateStop != ?', 0)
|
||||
->where('criteres.idClient = ?', $user->idClient)
|
||||
->where('criteres.login = ?', $user->username);
|
||||
$fini = $enrichissementsM->fetchAll($sql);
|
||||
$this->view->assign('fini', $fini);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user