string(2254) "SELECT m.*, l.*, IF(f.path IS NULL, 'https://brandsoutlet.pl/work/images/logo_c.webp', concat('https://brandsoutlet.pl/',f.path ,'S')) as image, COALESCE(f.com, '') as altimg, concat('EUR') as curr, concat('€') as currsign, ROUND(rrp.price9, 0) as rrp, rrp.price1 as priceeur, ROUND((rrp.price9-rrp.price1)/(rrp.price9/100)) as rrpprc, pl.price1 as price, pl.price1x as price2, ROUND((pl.price1*((100-m.discount)/100)), 2) as saleprice, ROUND(IF(m.discount>0, pl.price1, pl.price1x), 2) as oldprice, IF(pl.price1=0.0000, '',concat(ROUND(pl.price1, 2),' €')) as pricecurr, IF(pl.price1x=0.0000, '',concat(ROUND(pl.price1x, 2),' €')) as pricecurr2, IF(pl.price1=0.0000, '',concat(ROUND(pl.price1*((100-m.discount)/100), 2),' €')) as salepricecurr, concat(ROUND(IF(m.discount>0, pl.price1, pl.price1x), 2),' €') as oldpricecurr, IF(m.discount>0 OR pl.price1x>0, true, false) as onsale FROM ( SELECT mdb.* , a.amount as amount FROM msu_db mdb LEFT JOIN msu_ties mtb ON (mtb.msu=mdb.xid) LEFT JOIN ( SELECT mtx.msu, count(mtx.msu) as cn FROM msu_ties mtx WHERE mtx.cat='1205' OR mtx.cat='1205' GROUP BY mtx.msu ) mt ON (mt.msu=mdb.xid) INNER JOIN msu_ties AS t1205 ON t1205.msu = mdb.xid AND t1205.cat = '1205' INNER JOIN ( SELECT sa.msu as msu, SUM(sa.amount) as amount FROM whs5_batchs sa LEFT JOIN whs5_stores sr ON (sr.i=sa.store) WHERE sr.cust='10073' GROUP BY sa.msu ) a ON (a.msu=mdb.xid AND a.amount>0 ) LEFT JOIN ( SELECT om.name as name, COALESCE(SUM(om.amount), 0) as amount FROM whs5_msu om LEFT JOIN whs5_docs od ON (od.i=om.doc) LEFT JOIN whs5_stores sr ON (sr.i=od.store) WHERE od.s='e' AND od.l='y' AND od.type=17 AND (od.o='c' OR od.o='o') AND sr.cust='10073' GROUP BY om.name ) ord ON (ord.name=mdb.xid) WHERE mdb.s='e' AND ( mtb.cat='1205') AND mdb.unpub<>'e' AND mt.cn='2' AND (ord.amount IS NULL OR ord.amount < a.amount) GROUP BY mdb.xid ORDER BY mdb.xid DESC, mdb.pos ASC LIMIT 24 OFFSET 3840) m LEFT JOIN msu_lang l ON (l.xid=m.xid AND l.lang='PL') LEFT JOIN fls_db f ON (f.i=m.def_img) LEFT JOIN msu_pricelist rrp ON (rrp.xid=m.xid) LEFT JOIN msu_pricelist pl ON (pl.xid=m.xid) WHERE m.s='e'"