Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.89 KB | None | 0 0
  1. select bs.entity_id, bs.bookstore_id, bs.floor, bs.column, bs.type,
  2.                     bs.description, pl.qty as quantity,
  3.                     if(pe.sku is null, 'simple', pe.type_id) as type_id,
  4.                     ifnull(pe.sku, pl.sku) as sku,
  5.                     pl.bundle_id as bundle_id,
  6.                     if(pl.bundle_id = 0, ifnull(name.value, fs.Name), bundle_name.value) as name,
  7.                     if(pl.bundle_id = 0, image.value, bundle_image.value) as image,
  8.                     ifnull(pr.value, fs.price) as price from fhs_bookshelf bs
  9.                     join fhs_bookshelf_product_location pl on bs.entity_id = pl.bookshelf_entity_id
  10.                     left join fahasa_stock fs on fs.sku = pl.sku
  11.                     left join fhs_catalog_product_entity pe on pe.sku = pl.sku
  12.                     left join fhs_catalog_product_entity_varchar name on name.entity_id = pe.entity_id and name.attribute_id=71
  13.                     left join fhs_catalog_product_entity_varchar image on image.entity_id = pe.entity_id and image.attribute_id=85
  14.                     LEFT JOIN fhs_catalog_product_entity_decimal pr ON pe.entity_id = pr.entity_id AND pr.attribute_id = 75
  15.                     left join fhs_catalog_product_entity bundle on bundle.entity_id = pl.bundle_id
  16.                     left join fhs_catalog_product_entity_varchar bundle_name on bundle_name.entity_id = bundle.entity_id and bundle_name.attribute_id=71
  17.                     left join fhs_catalog_product_entity_varchar bundle_image on bundle_image.entity_id = bundle.entity_id and bundle_image.attribute_id=85
  18.                     where bs.bookstore_id = {$bookstoreId}
  19.                     and bs.floor = {$bookshelfData['floor']}
  20.                     and bs.column = {$bookshelfData['bookshelfId']}
  21.                     and bs.type = '{$bookshelfData['type']}'
  22.                     and bs.row = {$bookshelfData['row']};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement