im Tabellenprodukt
Code: Select all
id name
1 abc
2 def
3 ghi
Code: Select all
id id_product id_catalogue
1 2 1
2 3 2
Code: Select all
id produt name value id_catalogue
1 abc false null
2 def checked 1
3 ghi false null
Eigentlich habe ich das, was meine Abfrage betrifft, die nicht gut funktioniert
Code: Select all
id produt name value id_catalogue
1 abc false null
2 def checked 1
3 ghi checked null
Code: Select all
$this->datatables->select("frs.raison_sociale as fournisseur,f.titre as famille,sf.titre as sous_famille,p.attribut as attribut,p.pa_centrale as prix_achat,p.marge_centrale as marge_centrale,p.pa_magasin as pa_magasin,p.marge_magasin as marge_magsin,p.prix_ht_public as public_ht,p.prix_ttc_public as public_ttc,p.id as id
,IF (cc.id_catalogue='".$id."', 'checked', FALSE) checked
",FALSE)
->from('cat_produits p')
->where('p.suppr','0')
->join('fournisseurs frs','frs.id=p.id_fournisseur', 'left')
->join('cat_familles f','f.id=p.id_famille', 'left')
->join('cat_sous_familles sf','sf.id=p.id_sous_famille', 'left')
->join('cat_cat_produits cc','cc.id_produit=p.id','left')
->edit_column('id', '', 'id,checked');
Code: Select all
missing cc.id_catalogue in select
Code: Select all
IF (cc.id_catalogue='".$id."', 'checked', '') checked
Code: Select all
IF (cc.id_catalogue='".$id."', 'checked', '') as checked
Mobile version