Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*set stock*/
- 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 realtime_hcm, thuong_mai_dien_tu_ha_noi, hn.qty as realtime_hn, tiki,
- si.*
- from fhs_catalog_product_entity pe
- left join fhs_cataloginventory_stock_status ss on ss.product_id = pe.entity_id
- left 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 ('8935280903517-qt','8935280903517','bm-8935280903517','pt-8935280903517');
- update 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
- set ss.stock_status = 1, ss.qty = 50, si.qty = 50, si.is_in_stock = 1
- where pe.sku in ('8935280903517-qt','8935280903517','bm-8935280903517','pt-8935280903517');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement