SHARE
TWEET

Untitled

a guest Aug 19th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*set stock*/
  2. select pe.sku, eDate.value as expectedDate, soonRelease.value as soon_release, ss.stock_status, ss.qty as stock_status_qty,
  3. 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,
  4. si.*
  5. from fhs_catalog_product_entity pe
  6. left join fhs_cataloginventory_stock_status ss on ss.product_id = pe.entity_id
  7. left join fhs_cataloginventory_stock_item si on pe.entity_id = si.product_id
  8. left join fahasa_bookstore_stock fbs on fbs.mabh = pe.sku
  9. LEFT JOIN fhs_catalog_product_entity_int soonRelease ON pe.entity_id = soonRelease.entity_id AND soonRelease.attribute_id = 155
  10. left join fhs_catalog_product_entity_datetime eDate ON pe.entity_id = eDate.entity_id AND eDate.attribute_id = 191
  11. left join (
  12.     select loc.sku, sum(loc.qty) as qty
  13.     from fhs_bookshelf_product_location loc
  14.     join fhs_bookshelf b on b.entity_id = loc.bookshelf_entity_id
  15.     where b.bookstore_id in (67)
  16.     group by loc.sku
  17. ) as hcm on hcm.sku = pe.sku
  18. left join (
  19.     select loc.sku, sum(loc.qty) as qty
  20.     from fhs_bookshelf_product_location loc
  21.     join fhs_bookshelf b on b.entity_id = loc.bookshelf_entity_id
  22.     where b.bookstore_id in (89)
  23.     group by loc.sku
  24. ) as hn on hn.sku = pe.sku
  25. where pe.sku in ('8935280903517-qt','8935280903517','bm-8935280903517','pt-8935280903517');
  26.  
  27.  
  28. update fhs_catalog_product_entity pe
  29. join fhs_cataloginventory_stock_status ss on ss.product_id = pe.entity_id
  30. join fhs_cataloginventory_stock_item si on pe.entity_id = si.product_id
  31. set ss.stock_status = 1, ss.qty = 50, si.qty = 50, si.is_in_stock = 1
  32. where pe.sku in ('8935280903517-qt','8935280903517','bm-8935280903517','pt-8935280903517');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top