From 89b8628ed5377aaafd09dca5306f1b6cad4ae3aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 May 2007 22:40:07 +0000 Subject: [PATCH] =?UTF-8?q?Perf:=20Am=E9lioration=20perf=20requete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/commande/commande.class.php | 3 +-- htdocs/facture.class.php | 3 +-- htdocs/propal.class.php | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index a4d36e4cf0a..3c44014fa51 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -2284,10 +2284,9 @@ class Commande extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = co.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; } - $sql.= " WHERE 1 = 1"; if ($conf->categorie->enabled && !$user->rights->categorie->voir) { - $sql.= " AND IFNULL(c.visible,1)=1"; + $sql.= " WHERE IFNULL(c.visible,1)=1"; } $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 54517b9be00..12626b8858f 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -2666,10 +2666,9 @@ class Facture extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = f.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; } - $sql.= " WHERE 1 = 1"; if ($conf->categorie->enabled && !$user->rights->categorie->voir) { - $sql.= " AND IFNULL(c.visible,1)=1"; + $sql.= " WHERE IFNULL(c.visible,1)=1"; } $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 50c0440d97b..7d047d714b4 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -2045,10 +2045,9 @@ class Propal extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; } - $sql.= " WHERE 1 = 1"; if ($conf->categorie->enabled && !$user->rights->categorie->voir) { - $sql.= " AND IFNULL(c.visible,1)=1"; + $sql.= " WHERE IFNULL(c.visible,1)=1"; } $resql=$this->db->query($sql); if ($resql)