fix query
This commit is contained in:
parent
b221e2eaf5
commit
48288ea952
@ -260,12 +260,12 @@ class AdminLogisticsPending extends AdminTab {
|
||||
$_orders = array();
|
||||
foreach(Db::getInstance()->ExecuteS('
|
||||
SELECT d.`id_order`, p.`id_product`, c.`id_sale`, GREATEST(d.`product_quantity` - d.`product_quantity_return`, 0) AS `product_quantity`,
|
||||
d.`product_reference`, COUNT(d.id_order_detail) as `nb_p`,
|
||||
d.`product_reference`, COUNT(d.id_order_detail) AS `nb_p`,
|
||||
CASE
|
||||
WHEN SUBSTRING(ca.`name`, 1,1) = "T" THEN 1
|
||||
WHEN SUBSTRING(ca.name`, 1,1) = "C" THEN 1
|
||||
ELSE '2'
|
||||
END as `carrier_name`
|
||||
WHEN SUBSTRING(ca.`name`, 1,1) = "C" THEN 1
|
||||
ELSE 2
|
||||
END AS `carrier_name`
|
||||
FROM `'._DB_PREFIX_.'privatesale_category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p ON c.`id_category` = p.`id_category_default`
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` d ON d.`product_id` = p.`id_product`
|
||||
|
Loading…
Reference in New Issue
Block a user