wrong join, request too long

This commit is contained in:
Quentin VIAL-GOUTEYRON 2021-06-02 10:32:30 +02:00
parent 33a4c98dc3
commit 89f6b66c2a

View File

@ -232,7 +232,7 @@ if ($modecompta == 'CREANCES-DETTES')
if ($selected_cat === -2) { // Without any category
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
} elseif ($selected_cat) { // Into a specific category
$sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON (cp.fk_product = p.rowid) INNER JOIN ".MAIN_DB_PREFIX."categorie as c ON (cp.fk_categorie = c.rowid)";
}
$sql .= " WHERE l.fk_facture = f.rowid";
$sql .= " AND f.fk_statut in (1,2)";