PrestashopUser03 Posted June 27, 2022 Share Posted June 27, 2022 Bonjour à tous, La fonction de recherche du filtre de l'admin controller ne fonctionne pas, voici le message qui s'affiche : Mauvaise requête SQL Unknown column 'tnom' in 'where clause' et voici le code : parent::__construct(); $this->bootstrap = true; // use Bootstrap CSS $this->table = 'hba_abonnement'; // SQL table name, will be prefixed with _DB_PREFIX_ $this->identifier = 'id_abonnement'; // SQL column to be used as primary key $this->className = 'HBAAbonnement'; // PHP class name $this->allow_export = true; // allow export in CSV, XLS. $this->_select = 'p.nom as pnom, tv.nom as tvnom,tv.id_type_value as tvid, t.nom as tnom, c.lastname as cnom, c.firstname as cprenom'; $this->_defaultOrderBy = 'hba_id_produit'; // the table alias is always `a` $this->_defaultOrderWay = 'ASC'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.id_customer=a.client_id) LEFT JOIN `'._DB_PREFIX_.'hba_produit` p ON (a.product_id=p.product_id) LEFT JOIN `'._DB_PREFIX_.'hba_type_value` tv ON (p.type_value_id=tv.id_type_value) LEFT JOIN `'._DB_PREFIX_.'hba_type` t ON (tv.type_id=t.id_type) '; $this->_defaultOrderBy = 'id_abonnement'; // the table alias is always `a` $this->_defaultOrderWay = 'DESC'; $this->fields_list = [ 'id_abonnement' => ['title' => 'ID','class' => 'fixed-width-xs', 'remove_onclick' => true], 'tnom' => ['title' => 'Type d\'abonnement', 'remove_onclick' => true], 'tvnom' =>['title'=>'Type de vélo', 'remove_onclick' => true], 'cnom'=>['title'=>'Nom', 'remove_onclick' => true], 'cprenom'=>['title'=>'Prénom', 'remove_onclick' => true], 'date_debut'=>['title'=>'Date de début', 'type'=>'date', 'remove_onclick' => true], 'date_fin'=>['title'=>'Date de fin','type'=>'date', 'remove_onclick' => true], 'product_id'=>['title'=>'Vélo lié à l\'abonnement', 'callback'=>'liste_materiel', 'remove_onclick' => true], 'erreur_de_paiement'=>['title'=>'Paiement valide', 'callback'=>'display_erreur_de_paiement', 'remove_onclick' => true], 'actif'=>['title'=>'Abonnement actif', 'callback'=>'display_desactivation_abo', 'remove_onclick' => true], ]; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now