Perf: Amlioration perf requete

This commit is contained in:
Laurent Destailleur
2007-05-04 22:40:07 +00:00
parent 950de6f884
commit 89b8628ed5
3 changed files with 3 additions and 6 deletions

View File

@@ -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)