Skip to content

Instantly share code, notes, and snippets.

View lucasqm's full-sized avatar
🎯
Focusing

Lucas Quintela lucasqm

🎯
Focusing
View GitHub Profile
@lucasqm
lucasqm / price_index.sql
Created October 4, 2018 18:27
Índice de preço por categoria - Magento 2
SELECT
`i`.entity_id,
`i`.price,
`i`.final_price,
`i`.min_price,
`i`.max_price
FROM
`catalog_product_index_price` AS `i`
INNER JOIN `catalog_category_product_index` AS `cat_index` ON
cat_index.product_id = i.entity_id
@lucasqm
lucasqm / category_selection.sql
Last active October 4, 2018 17:39
Seleção de produto por categoria - Magento 2
SELECT
`e` .*,
`cat_index`.`position` AS `cat_index_position`,
`stock_status_index`.`stock_status` AS `is_salable`,
`price_index`.`price`,
`price_index`.`tax_class_id`,
`price_index`.`final_price`,
IF( price_index.tier_price IS NOT NULL,
LEAST( price_index.min_price,
price_index.tier_price ),