SELECT
shop_order.id AS id_order,
shop_order.name AS name_order,
shop_order.adress,
shop_order.phone,
shop_order.status,
order_product.product_count,
product.name AS name_product,
product.price,
SUM(product.price) AS sum_total
FROM
bot_shop_order_product order_product
INNER JOIN bot_shop_order shop_order ON
shop_order.id = order_product.parent_id
INNER JOIN bot_shop_product product ON
product.id = order_product.parent_id
WHERE
order_product.magazin = 26
SELECT
(SELECT T2.name
FROM bot_shop_category AS T2
WHERE T2.sub_category = T1.id
) AS id_subcategory
FROM
bot_shop_category AS T1
WHERE T1.name = :name
GROUP BY id_subcategory
[name: 'Название книги', id_category:{'1','3','86'} ]
[name: 'Название книги 2', id_category:{'8,'36','186'} ]
Все, одного человека только. А там несколько их. Данные по заказу верные, так же товар верный, но товаров может быть больше. Но главное что не выводит все заказы.