I'm new to magento 2, I have a query to join multiple table, only 1 custom table I've made and the rest is from Magento 2, the query looks like this:
SELECT
marketplace_orders.entity_id as id,
marketplace_orders.product_ids as product_ids,
sales_order.entity_id as order_id,
sales_order.status as order_status,
sales_order.state as order_state,
customer_entity.entity_id as seller_id,
CONCAT(customer_entity.firstname," ",customer_entity.lastname) as seller_name,
sales_order_address.telephone as seller_telephone,
customer_entity.email as seller_email
FROM marketplace_orders
INNER JOIN sales_order
ON sales_order.entity_id = marketplace_orders.order_id
AND sales_order.status IN ("pending","processing")
LEFT JOIN customer_entity
ON customer_entity.entity_id = marketplace_orders.seller_id
LEFT JOIN sales_order_address
ON sales_order_address.parent_id = sales_order.entity_id
marketplace_orders
structure:
order_id => foreign key from sales_order
seller_id => foreign key from customer_entity
product_ids => order item ids
This query will join the sales_order_item with the other table, and I need to show it in Magento 2 Admin grid, is there a way to produce the grid with that join table query?