{"status":"error","error":"query_failed","query":"SELECT SQL_CALC_FOUND_ROWS\r\n\t\t\tproducts.id,products.code,\r\n\t\t\t\tproducts.seriesid,products.designerid,products.isbook,\r\n\t\t\t\tmin(price) as price,max(price) as maxprice,\r\n\t\t\t\tmin(price_discount) as price_discount,max(price_discount) as maxprice_discount,\r\n\t\t\t\tproducts.title_el as title,\r\n\t\t\t\tproducts.author_el as author,\r\n\t\t\t\tproducts.translator_el as translator,\r\n\t\t\tgroup_concat(distinct pictures.id,'^',pictures.safename,'^',pictures.extension order by pictures.picturetypeid desc,pictureorder asc separator '|') as pics,\r\n\t\t\tcount(pictures.id) as picsnum,\r\n\t\t\t\tproducts_sku.safetyquantity+ifnull(reserved.q,0) as safetyquantity,\r\n\t\t\t\tsum(qty) as totalpieces,popularity,\r\n\t\t\tgroup_concat(products_subcats.subcategoryid) as subcats,\r\n\t\t\tcount(distinct products_sku.sku) as skus,\r\n\t\t\tbiblionet,\r\n\t\t\tgroup_concat(distinct products_sku.sku) as skustext\r\n\t\tfrom products\r\n\t\t\t\tleft join pictures on (pictures.articleid=products.id and pictures.type=5)\r\n\t\t\t,products_subcats,products_sku\r\n\t\t\t\tleft join (select order_items.sku,sum(order_items.quantity) as q\r\n\t\t\t\t\tfrom orders,order_items\r\n\t\t\t\t\twhere order_items.orderid=orders.id\r\n\t\t\t\t\tand orders.status in (4,5,6)\r\n\t\t\t\t\tand atlantisstatus<2\r\n\t\t\t\t\tgroup by sku\r\n\t\t\t\t\torder by sku) as reserved on (reserved.sku=products_sku.sku)\r\n\t\t\tleft join products_stock on (products_stock.sku=products_sku.sku)\r\n\t\twhere 1=1 \r\n\t\t\tand products.active_el=1\r\n\t\t\tand products.id=products_sku.productid\r\n\t\t\tand products_sku.price>0\r\n\t\t\tand products_sku.active=1\r\n\t\t\t-- and (products.title_el is not null && products.title_el!='')\r\n\t\t\tand products_subcats.productid=products.id\r\n\t\t\t and products.id in (select productid from products_subcats where subcategoryid in (63)) and products.isbook=1 \r\n\t\tgroup by products.id\r\n\t\thaving (picsnum>0 || (isbook=1 && biblionet!=-1))\r\n\t\torder by popularity desc,products.title_el,products.code desc\r\n\t\tlimit -16,16","dberrno":null,"dberror":null}