Bonjour,
J'aimerais afficher les infos de 3 tables dans mon formulaire mais mon premier INNER JOIN se fait ré-écrire par mon second INNER JOIN.
Conclusion : seules les infos de la table principale (reception) et du second INNER JOIN (avec la table fournisseur) s'affichent.
Y-a-t-il une solution rapide et propre pour corriger ce problème ou est-ce qu'il vaut mieux changer la forme de mon JOIN avec un SELECT x FROM a WHERE b ?
public function __construct(){ $this->bootstrap = true; //Gestion de l'affichage en mode bootstrap $this->table = 'gp_reception'; //Table de l'objet $this->identifier = 'id_reception'; //Clé primaire de l'objet $this->className = Reception::class; //Classe de l'objet $this->lang = false; //Flag pour dire si utilisation de langues ou non $this->_join = 'INNER JOIN '._DB_PREFIX_. 'GP_' . 'ingredient i ON (a.id_ingredient = i.id_ingredient)'; $this->_select = 'i.nom_ingredient AS `ingredient_reception`'; $this->_join = 'INNER JOIN '._DB_PREFIX_. 'GP_' . 'fournisseur f ON (a.id_fournisseur = f.id_fournisseur)'; $this->_select = 'f.nom_fournisseur AS `fournisseur_reception`'; //Liste des champs de l'objet à afficher dans la liste $this->fields_list = array( 'date_reception' => array('title' => 'Date', 'width' => 'auto'), 'ingredient_reception' => array('title' => 'Ingrédient', 'width' => 'auto'), 'fournisseur_reception' => array('title' => 'Fournisseur', 'width' => 'auto'), 'ingredient_quantite_reception' => array('title' => 'Quantité', 'width' => 'auto'), 'num_lot_fournisseur_reception' => array('title' => 'Num lot fournisseur', 'width' => 'auto'), 'num_lot_reception' => array('title' => 'Num lot', 'width' => 'auto'), 'quantite_conforme_reception' => array('title' => 'Conformité', 'width' => 'auto'), 'integrite_reception' => array('title' => 'Intégrité', 'width' => 'auto'), ); //Ajout d'actions sur chaque ligne //$this->addRowAction('view'); $this->addRowAction('edit'); $this->addRowAction('delete'); parent::__construct(); }
Merci 😃