2
我想檢索與訂單相關的所有詳細信息,例如order_id,與該訂單相關的產品以及magento數據庫中的大小,價格和顏色等產品屬性。這是我目前用來檢索訂單詳細信息的查詢。但我無法找到具有產品屬性詳細信息的表格。sql檢索magento中的所有訂單和產品詳細信息
SELECT
items.order_id AS order_id,
concat(address.firstname,' ',address.lastname) as name,
address.email AS Email,
items.created_at AS Date,
orders.base_subtotal as sub_order_total,
orders.base_grand_total as order_total,
address.city as order_city,
address.telephone as phone_number,
address.region as order_region,
items.row_total_incl_tax as product_price,
items.name as product_name,
items.description as product_description
FROM
sales_flat_order_address AS address
JOIN
sales_flat_order AS orders
ON orders.entity_id = address.parent_id
JOIN sales_flat_order_item AS items
ON items.order_id = orders.entity_id
WHERE orders.status = 'complete'
group by 1,2,3,4,5,6,7,8,9,10,11,12
order by 1;