SELECT b.id, b.sent, a.description agency, m.code method FROM myBasket b JOIN vn.agencyMode a ON a.id = b.agencyModeFk JOIN vn.deliveryMethod m ON m.id = b.deliveryMethodFk CREATE TEMPORARY TABLE tmp.bionic_calc (INDEX (item_id)) ENGINE = MEMORY SELECT i.id item_id FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk WHERE #filter; CALL bionic_calc; SELECT i.id itemFk, i.description, b.available, b.price, b.producer, i.image, i.name item, i.category, i.size, IF(i.stems > 1, i.stems, NULL) stems, c.name color, o.name origin, t.tag1, t.val1, t.tag2, t.val2, t.tag3, t.val3 FROM tmp.bionic_item b JOIN vn.item i ON i.id = b.item_id LEFT JOIN vn.itemTagArranged t ON t.itemFk = i.id LEFT JOIN vn.producer p ON p.id = i.producerFk LEFT JOIN vn.inkL10n c ON c.id = i.inkFk LEFT JOIN vn.originL10n o ON o.id = i.originFk WHERE b.available > 0 ORDER BY i.relevancy DESC, i.name, i.size LIMIT 400;

Catalog

,

from

SELECT c.id, l.name, c.color FROM vn.itemCategory c JOIN vn.itemCategoryL10n l ON l.id = c.id WHERE c.display ORDER BY name

Choose a realm

Filter by

CALL item_available (); SELECT DISTINCT t.id, l.name FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk JOIN tmp.item_available a ON a.item_id = i.id JOIN vn.itemTypeL10n l ON l.id = t.id WHERE #filter ORDER BY name CALL item_available (); SELECT DISTINCT l.id, l.name FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk JOIN tmp.item_available a ON a.item_id = i.id JOIN vn.inkL10n l ON l.id = i.inkFk WHERE #filter ORDER BY name CALL item_available (); SELECT DISTINCT p.id, p.name FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk JOIN tmp.item_available a ON a.item_id = i.id JOIN vn.producer p ON p.id = i.producerFk WHERE #filter ORDER BY name CALL item_available (); SELECT DISTINCT o.id, l.name, o.code FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk JOIN tmp.item_available a ON a.item_id = i.id JOIN vn.origin o ON o.id = i.originFk JOIN vn.originL10n l ON l.id = o.id WHERE #filter ORDER BY name CALL item_available (); SELECT DISTINCT i.category, i.category FROM vn.item i JOIN vn.itemType t ON t.id = i.typeFk JOIN tmp.item_available a ON a.item_id = i.id WHERE #filter ORDER BY category

Order by

SELECT i.description, o.name origin FROM vn.item i LEFT JOIN vn.originL10n o ON o.id = i.originFk WHERE i.id = #item

@

SELECT l.name, it.value FROM vn.itemTag it JOIN vn.tag t ON t.id = it.tagFk JOIN vn.tagL10n l ON l.id = t.id WHERE it.itemFk = #item

CALL bionic_from_item (#item); SELECT w.id warehouseFk, w.name warehouse, p.grouping, p.price, p.rate, l.available FROM tmp.bionic_lot l JOIN tmp.bionic_price p ON p.warehouse_id = l.warehouse_id JOIN vn.warehouse w ON w.id = p.warehouse_id ORDER BY warehouseFk, grouping;