Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select pe.sku, eDate.value as expectedDate, soonRelease.value as soon_release, ss.stock_status, ss.qty as stock_status_qty,
- si.qty as stock_item_qty, si.is_in_stock, thuong_mai_dien_tu, hcm.qty as hcm, thuong_mai_dien_tu_ha_noi, hn.qty as hn, tiki
- from fhs_catalog_product_entity pe
- join fhs_cataloginventory_stock_status ss on ss.product_id = pe.entity_id
- join fhs_cataloginventory_stock_item si on pe.entity_id = si.product_id
- left join fahasa_bookstore_stock fbs on fbs.mabh = pe.sku
- LEFT JOIN fhs_catalog_product_entity_int soonRelease ON pe.entity_id = soonRelease.entity_id AND soonRelease.attribute_id = 155
- left join fhs_catalog_product_entity_datetime eDate ON pe.entity_id = eDate.entity_id AND eDate.attribute_id = 191
- left join (
- select loc.sku, sum(loc.qty) as qty
- from fhs_bookshelf_product_location loc
- join fhs_bookshelf b on b.entity_id = loc.bookshelf_entity_id
- where b.bookstore_id in (67)
- group by loc.sku
- ) as hcm on hcm.sku = pe.sku
- left join (
- select loc.sku, sum(loc.qty) as qty
- from fhs_bookshelf_product_location loc
- join fhs_bookshelf b on b.entity_id = loc.bookshelf_entity_id
- where b.bookstore_id in (89)
- group by loc.sku
- ) as hn on hn.sku = pe.sku
- where pe.sku in ('1901011270675','1901011270712','8935073071591','9786045711422','8938520686065','8935086843727','8935001801856-xanh','8801237806081-hong','8801237806081-xanhtroi','8935001882152-xanhla','8936044394039-xanhla','8935219420030-do','8935219420030-xanhduong','8858121000513-do','8935001823629-hongvangvan','bm-9786045541791','pt-9786045541791','bm-8936062804527','1901011126101-tim','8934986000193-mau4','1507020104057-vang','1507020104057-trang');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement