Fix sql error

This commit is contained in:
Laurent Destailleur 2016-01-10 12:37:48 +01:00
parent 59765f81c5
commit cc4c5873e6
2 changed files with 2 additions and 4 deletions

View File

@ -346,9 +346,7 @@ class Productcustomerprice extends CommonObject
}
}
}
if (!empty($sortfield)) {
$sql.= $this->db->order($sortfield, $sortorder);
}
$sql.= $this->db->order($sortfield, $sortorder);
if (! empty($limit)) $sql .= ' ' . $this->db->plimit($limit + 1, $offset);
dol_syslog(get_class($this) . "::fetch_all", LOG_DEBUG);

View File

@ -1423,7 +1423,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
// Count total nb of records
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $prodcustprice->fetch_all($sortfield, $sortorder, 0, 0, $filter);
$nbtotalofrecords = $prodcustprice->fetch_all($sortorder, $sortfield, 0, 0, $filter);
}
$result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);