Possible solution for the problem "SELECT * is forbidden by SQL rules"
This commit is contained in:
parent
0f9b01cd5b
commit
0c68a7b0e6
@ -590,10 +590,15 @@ abstract class CommonDocGenerator
|
|||||||
$resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs);
|
$resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs);
|
||||||
|
|
||||||
// Add the product supplier extrafields to the substitutions
|
// Add the product supplier extrafields to the substitutions
|
||||||
$resql = $this->db->query("SELECT * FROM " . MAIN_DB_PREFIX . "product_fournisseur_price_extrafields AS ex INNER JOIN " . MAIN_DB_PREFIX . "product_fournisseur_price AS f ON ex.fk_object = f.rowid WHERE f.ref_fourn = " . $line->ref_fourn);
|
$extralabels=$extrafields->fetch_name_optionals_label("product_fournisseur_price");
|
||||||
|
$columns = "";
|
||||||
|
foreach ($extralabels as $key => $value) {
|
||||||
|
$columns .= "$key, ";
|
||||||
|
}
|
||||||
|
substr($columns, 0, strlen($columns) - 2);
|
||||||
|
$resql = $this->db->query("SELECT $columns FROM " . MAIN_DB_PREFIX . "product_fournisseur_price_extrafields AS ex INNER JOIN " . MAIN_DB_PREFIX . "product_fournisseur_price AS f ON ex.fk_object = f.rowid WHERE f.ref_fourn = " . $line->ref_fourn);
|
||||||
if ($this->db->num_rows($resql) > 0) {
|
if ($this->db->num_rows($resql) > 0) {
|
||||||
$resql = $this->db->fetch_object($resql);
|
$resql = $this->db->fetch_object($resql);
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label("product_fournisseur_price");
|
|
||||||
foreach ($extralabels as $key => $value) {
|
foreach ($extralabels as $key => $value) {
|
||||||
$resarray['line_product_supplier_'.$key] = $resql->{$key};
|
$resarray['line_product_supplier_'.$key] = $resql->{$key};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user