Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select bs.entity_id, bs.bookstore_id, bs.floor, bs.column, bs.type,
- bs.description, pl.qty as quantity,
- if(pe.sku is null, 'simple', pe.type_id) as type_id,
- ifnull(pe.sku, pl.sku) as sku,
- pl.bundle_id as bundle_id,
- if(pl.bundle_id = 0, ifnull(name.value, fs.Name), bundle_name.value) as name,
- if(pl.bundle_id = 0, image.value, bundle_image.value) as image,
- ifnull(pr.value, fs.price) as price from fhs_bookshelf bs
- join fhs_bookshelf_product_location pl on bs.entity_id = pl.bookshelf_entity_id
- left join fahasa_stock fs on fs.sku = pl.sku
- left join fhs_catalog_product_entity pe on pe.sku = pl.sku
- left join fhs_catalog_product_entity_varchar name on name.entity_id = pe.entity_id and name.attribute_id=71
- left join fhs_catalog_product_entity_varchar image on image.entity_id = pe.entity_id and image.attribute_id=85
- LEFT JOIN fhs_catalog_product_entity_decimal pr ON pe.entity_id = pr.entity_id AND pr.attribute_id = 75
- left join fhs_catalog_product_entity bundle on bundle.entity_id = pl.bundle_id
- left join fhs_catalog_product_entity_varchar bundle_name on bundle_name.entity_id = bundle.entity_id and bundle_name.attribute_id=71
- left join fhs_catalog_product_entity_varchar bundle_image on bundle_image.entity_id = bundle.entity_id and bundle_image.attribute_id=85
- where bs.bookstore_id = {$bookstoreId}
- and bs.floor = {$bookshelfData['floor']}
- and bs.column = {$bookshelfData['bookshelfId']}
- and bs.type = '{$bookshelfData['type']}'
- and bs.row = {$bookshelfData['row']};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement