diff --git a/stats/statsbestmanufacturers.php b/stats/statsbestmanufacturers.php index 2c48f76..157b00e 100644 --- a/stats/statsbestmanufacturers.php +++ b/stats/statsbestmanufacturers.php @@ -145,7 +145,7 @@ public function getTotalCount() */ public function getData($layers = null) { - $query = 'SELECT m.name, SUM(od.product_quantity) AS quantity, ROUND(SUM(od.product_quantity * od.product_price) / c.conversion_rate, 2) AS sales + $query = 'SELECT m.name, SUM(od.product_quantity) AS quantity, ROUND(SUM(od.product_quantity * od.product_price / c.conversion_rate), 2) AS sales FROM ' . _DB_PREFIX_ . 'order_detail od LEFT JOIN ' . _DB_PREFIX_ . 'product p ON p.id_product = od.product_id LEFT JOIN ' . _DB_PREFIX_ . 'orders o ON o.id_order = od.id_order diff --git a/stats/statsbestsuppliers.php b/stats/statsbestsuppliers.php index 4871d15..5769213 100644 --- a/stats/statsbestsuppliers.php +++ b/stats/statsbestsuppliers.php @@ -146,7 +146,7 @@ public function getTotalCount() */ public function getData($layers = null) { - $query = 'SELECT s.name, SUM(od.product_quantity) AS quantity, ROUND(SUM(od.product_quantity * od.product_price) / o.conversion_rate, 2) AS sales + $query = 'SELECT s.name, SUM(od.product_quantity) AS quantity, ROUND(SUM(od.product_quantity * od.product_price / o.conversion_rate), 2) AS sales FROM ' . _DB_PREFIX_ . 'order_detail od LEFT JOIN ' . _DB_PREFIX_ . 'product p ON p.id_product = od.product_id LEFT JOIN ' . _DB_PREFIX_ . 'orders o ON o.id_order = od.id_order diff --git a/stats/statsbestvouchers.php b/stats/statsbestvouchers.php index d8e8c27..ee030ca 100644 --- a/stats/statsbestvouchers.php +++ b/stats/statsbestvouchers.php @@ -148,7 +148,7 @@ public function hookAdminStatsModules() public function getData($layers = null) { $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); - $this->query = 'SELECT cr.code, ocr.name, COUNT(ocr.id_cart_rule) AS total, ROUND(SUM(o.total_paid_real) / o.conversion_rate,2) AS ca + $this->query = 'SELECT cr.code, ocr.name, COUNT(ocr.id_cart_rule) AS total, ROUND(SUM(o.total_paid_real / o.conversion_rate),2) AS ca FROM ' . _DB_PREFIX_ . 'order_cart_rule ocr LEFT JOIN ' . _DB_PREFIX_ . 'orders o ON o.id_order = ocr.id_order LEFT JOIN ' . _DB_PREFIX_ . 'cart_rule cr ON cr.id_cart_rule = ocr.id_cart_rule