MODx encountered the following error while attempting to parse the requested resource: | ||
« Execution of a query to the database failed - Got error 28 from storage engine » | ||
SQL:
SELECT SQL_CALC_FOUND_ROWS
p.id, p.id AS idpr, p.alias, c.parent, p.xml_desc, p.nameR as name, imgNum as img, p.`descR` as `desc`, IF((p.`altR` = ""),p.nameR,p.`altR`) as `alt`, IF((p.`imgTitleR` = ""),p.nameR,p.`imgTitleR`) as imgTitle, p.deniedOrder, IF(ISNULL(cMain.alias),"product",cMain.alias) as `mainCatAlias`, IF(0=1,(opt.price + 1600),(((opt.price + opt.PPDisc))*5.202599999999998*if(isnull(opt.mlt),1,opt.mlt)+if(isnull(opt.plus),0,opt.plus)+0+1600)) as price,
if(opt.old_price>0,opt.old_price*5.202599999999998*if(isnull(opt.mlt),1,opt.mlt)+if(isnull(opt.plus),0,opt.plus)+0+1600,0) as old_price
FROM `alpha_fl_product_cat` AS a
LEFT JOIN `alpha_fl_category` as c ON c.id=a.idcat
LEFT JOIN `alpha_fl_product` AS p ON p.id= a.idpr
LEFT JOIN `alpha_fl_category` AS cMain ON cMain.id=p.id_main_category
LEFT JOIN `alpha_fl_partner_product` AS pp ON pp.id_product = p.id
LEFT JOIN `alpha_fl_product_sequ` AS s ON (s.idcat=a.idcat OR s.idcat=c.parent) AND s.idpr=a.idpr
LEFT JOIN `alpha_fl_city_product` as pc ON pc.id_pr = a.idpr AND pc.id_city=12859
LEFT JOIN `alpha_fl_view_product_cat_city` as pcc ON pcc.idpr = a.idpr and pcc.idcity = "12859"
LEFT JOIN `alpha_fl_view_product_cat_countrys` as pccs ON pccs.idpr = a.idpr and pccs.idctr = "175"
LEFT JOIN `alpha_fl_country_product` as cp ON cp.id_pr = a.idpr AND cp.id_ctr = "175"
LEFT OUTER JOIN (
SELECT * FROM alpha_fl_category_city as cc WHERE cc.idcity=12859
) as cc ON cc.idcat=c.id
LEFT OUTER JOIN (
SELECT
a.id,
IF(ISNULL(pr_price.price), a.price, pr_price.price) AS price,
a.old_price,
(
select exp(sum(log(`value`))) as coefMlt
FROM `alpha_fl_coef` as fc
WHERE fc.id_pr = a.id AND (fc.ftype = 1 OR fc.id_city = "12859" OR fc.id_ctr = "175" OR fc.id_region="1168")
AND "2024-03-29 0:0:1" BETWEEN CONCAT(YEAR("2024-03-29 0:0:1"), '-', fc.date_begin, ' 00:00:00' ) AND concat(YEAR("2024-03-29 0:0:1") , '-', fc.date_end, ' 23:59:59')
AND fc.`type`=0
AND fc.disabled=0
) as Mlt,(
select sum(`value`) as Plus
FROM `alpha_fl_coef` as fc
WHERE fc.id_pr=a.id AND (fc.ftype = 1 OR fc.id_city = "12859" OR fc.id_ctr = "175" OR fc.id_region="1168")
AND "2024-03-29 0:0:1" BETWEEN CONCAT(YEAR("2024-03-29 0:0:1") , '-', fc.date_begin, ' 00:00:00' ) AND concat(YEAR("2024-03-29 0:0:1") , '-',fc.date_end, ' 23:59:59')
AND fc.`type`=1
AND fc.disabled=0
) as Plus,
IF(ISNULL(pr_price.price),a.price,pr_price.price)/100*if(ISNULL((SELECT alpha_fl_partner_product.margin FROM alpha_fl_partner_product WHERE alpha_fl_partner_product.id_product=a.id)),0,(SELECT alpha_fl_partner_product.margin FROM alpha_fl_partner_product WHERE alpha_fl_partner_product.id_product=a.id)) as PPDisc
FROM `alpha_fl_view_product` as a
LEFT OUTER JOIN (
SELECT
p.id,
MIN(IF(!ISNULL(opc.price),opc.price,IF(!ISNULL(opr.price),opr.price,IF(!ISNULL(opct.price), opct.price, IF(!ISNULL(opb.price),opb.price,po.price))))) AS price
FROM alpha_fl_product as p
LEFT JOIN alpha_fl_product_opt as po ON p.id=po.idpr
LEFT JOIN alpha_fl_option_price as opc ON opc.id_option=po.id AND opc.id_city=12859
LEFT JOIN alpha_fl_option_price as opr ON opr.id_option=po.id AND opr.id_region=1168
LEFT JOIN alpha_fl_option_price as opct ON opct.id_option=po.id AND opct.id_country=175
LEFT JOIN alpha_fl_option_price as opb ON opb.id_option=po.id AND opb.id_city=0 AND opb.id_region=0 AND opb.id_country=0
WHERE 0 = 1 GROUP BY p.id
) AS pr_price ON pr_price.id=a.id
) opt ON opt.id=a.idpr
LEFT OUTER JOIN (SELECT COUNT(cpr.id) AS currentPromositeCount, prc.idpr FROM alpha_fl_category_promosite AS cpr LEFT JOIN alpha_fl_product_cat AS prc ON prc.idcat=cpr.id_category WHERE cpr.id_promosite="0" GROUP BY prc.idpr) as cpr ON cpr.idpr=p.id LEFT OUTER JOIN (SELECT COUNT(cpr.id) AS allPromositeCount, prc.idpr FROM alpha_fl_category_promosite AS cpr LEFT JOIN alpha_fl_product_cat AS prc ON prc.idcat=cpr.id_category GROUP BY prc.idpr) as allcpr ON allcpr.idpr=p.id
WHERE p.id_partner = "0" AND (isnull(cp.id_ctr) OR (cp.status=1 AND !isnull(pc.id_city))) AND isnull(cc.idcity) AND ISNULL(pcc.idcity) AND ISNULL(pccs.idctr) AND p.disabled = 0 AND c.public=1 AND (ISNULL(allcpr.allPromositeCount) || allcpr.allPromositeCount = 0 || (allcpr.allPromositeCount > 0 && cpr.currentPromositeCount > 0))
GROUP BY p.id
ORDER BY p.deniedOrder, price , p.nameR
LIMIT 240,12
[Copy SQL to ClipBoard] | ||
Parser timing | ||
MySQL: | 0.0399 s | (17 Requests) |
PHP: | 1.3022 s | |
Total: | 1.3422 s |