Site de licitatii gratuite si magazine online.

Error 500

[PDOException]
SQLSTATE[HY000]: General error: 1111 Invalid use of group function
[SQL]
(SELECT l.*, max(b.amount) as current_bid FROM sell_listings AS l LEFT JOIN sell_bids AS b ON b.listing_id = l.id WHERE (l.listing_type IN ('auction', 'product')) AND (l.draft = 0) AND (l.active = 1) AND (l.approved = 1) AND (l.closed = 0) AND (l.deleted = 0) AND (l.list_in != 'store') AND (l.catfeat = 1) GROUP BY l.id ORDER BY rand() LIMIT 8) UNION (SELECT l.*, max(b.amount) as current_bid FROM sell_listings AS l LEFT JOIN sell_bids AS b ON b.listing_id = l.id WHERE (l.listing_type IN ('auction', 'product')) AND (l.draft = 0) AND (l.active = 1) AND (l.approved = 1) AND (l.closed = 0) AND (l.deleted = 0) AND (l.list_in != 'store') GROUP BY l.id ORDER BY IF(l.listing_type='auction', IF(max(b.amount) is null, l.start_price, max(b.amount)), l.buyout_price) ASC) --> []
[File]
/home/sellonline/public_html/library/Cube/Db/Adapter/PDO/AbstractAdapter.php --> Line 245
[Trace]
#0 /home/sellonline/public_html/library/Cube/Db/Select.php(782): Cube\Db\Adapter\PDO\AbstractAdapter->query(Object(Cube\Db\Select))
#1 /home/sellonline/public_html/library/Cube/Paginator/Adapter/DbSelect.php(138): Cube\Db\Select->query()
#2 /home/sellonline/public_html/library/Cube/Paginator.php(574): Cube\Paginator\Adapter\DbSelect->count()
#3 /home/sellonline/public_html/library/Cube/Paginator.php(239): Cube\Paginator->_calculatePageCount()
#4 /home/sellonline/public_html/module/Listings/src/Listings/View/Helper/Listings.php(143): Cube\Paginator->setItemCountPerPage(20)
#5 /home/sellonline/public_html/module/Listings/view/listings/browse/index.phtml(22): Listings\View\Helper\Listings->fetchPaginator(Array, 'listings', Array)
#6 /home/sellonline/public_html/library/Cube/View.php(688): include('/home/sellonlin...')
#7 /home/sellonline/public_html/library/Cube/Controller/Dispatcher.php(126): Cube\View->process('/listings/brows...')
#8 /home/sellonline/public_html/library/Cube/Controller/Front.php(401): Cube\Controller\Dispatcher->dispatch(Object(Cube\Controller\Request\Rewrite), Object(Cube\Http\Response))
#9 /home/sellonline/public_html/library/Cube/Application/Bootstrap.php(233): Cube\Controller\Front->dispatch()
#10 /home/sellonline/public_html/library/Cube/Application.php(254): Cube\Application\Bootstrap->run()
#11 /home/sellonline/public_html/index.php(20): Cube\Application->run()
#12 {main}
AutoPlus24VindeUrgent | V-kauf.at | IntelHome | AquaWelt | Welthaus | FerestreShop | Welt-Auto