SELECT SQL_CALC_FOUND_ROWS
	distinct pro.ProductID,
	a.AuthorName,
	pro.extension,
	pro.ProductName,
	pro.ProductIsActive,
	pro.ProductQuantity,
	pro.ProductPrice AS price,
	promo.promo_price AS newPrice,
	promo.promo_percent,
	promo.promo_reduction,
	COALESCE(promo.promo_price, pro.ProductPrice) AS currentPrice
	FROM Products AS pro
	LEFT JOIN _promotions AS promo ON pro.ProductID = promo.ProductID
	LEFT JOIN Authors AS a ON pro.AuthorID = a.AuthorID
	JOIN CategoryProduct AS cp ON cp.ProductID=pro.ProductID WHERE ProductIsActive=1 AND (CONCAT(COALESCE(pro.ProductName, ''), COALESCE(a.AuthorName, '')) LIKE ?) AND pro.AuthorID IN (4) ORDER BY pro.ProductID DESC LIMIT 0, 24