当我使用下拉列表并选择按"新产品"这是: ?dir = asc& limit = 8& order =最新,该网站给出了通常的: "处理您的请求时出错 出于安全原因,默认情况下禁用例外打印。"
该报告包含:
a:5:{i:0;s:864:"SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price` FROM `mage_catalog_product_entity` AS `e`
INNER JOIN `mage_catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '13' AND cat_index.is_parent=1
INNER JOIN `mage_catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 ORDER BY `FIElD(e`.`entity_id, -1) DESC, created_at` DESC LIMIT 10
";i:1;s:5523:"#0 /home/mexicanos/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/mexicanos/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/mexicanos/public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /home/mexicanos/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `e`.*, `...', Array)
#4 /home/mexicanos/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `e`.*, `...', Array)
#5 /home/mexicanos/public_html/lib/Zend/Db/Adapter/Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `e`.*, `...', Array)
#6 /home/mexicanos/public_html/lib/Varien/Data/Collection/Db.php(734): Zend_Db_Adapter_Abstract->fetchAll('SELECT `e`.*, `...', Array)
#7 /home/mexicanos/public_html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(1045): Varien_Data_Collection_Db->_fetchAll('SELECT `e`.*, `...')
#8 /home/mexicanos/public_html/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(871): Mage_Eav_Model_Entity_Collection_Abstract->_loadEntities(false, false)
#9 /home/mexicanos/public_html/app/code/core/Mage/Review/Model/Observer.php(78): Mage_Eav_Model_Entity_Collection_Abstract->load()
#10 /home/mexicanos/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_Review_Model_Observer->catalogBlockProductCollectionBeforeToHtml(Object(Varien_Event_Observer))
#11 /home/mexicanos/public_html/app/code/core/Mage/Core/Model/App.php(1311): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Review_Model_Observer), 'catalogBlockPro...', Object(Varien_Event_Observer))
#12 /home/mexicanos/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_block_p...', Array)
#13 /home/mexicanos/public_html/app/code/core/Mage/Catalog/Block/Product/List.php(164): Mage::dispatchEvent('catalog_block_p...', Array)
#14 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Abstract.php(918): Mage_Catalog_Block_Product_List->_beforeToHtml()
#15 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#16 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('product_list', true)
#17 /home/mexicanos/public_html/app/code/core/Mage/Catalog/Block/Category/View.php(90): Mage_Core_Block_Abstract->getChildHtml('product_list')
#18 /home/mexicanos/public_html/app/design/frontend/base/default/template/catalog/category/view.phtml(70): Mage_Catalog_Block_Category_View->getProductListHtml()
#19 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/mexica...')
#20 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')
#21 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#22 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#23 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#24 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#25 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#26 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#27 /home/mexicanos/public_html/app/design/frontend/mexicanos/default/template/page/2columns-left.phtml(57): Mage_Core_Block_Abstract->getChildHtml('content')
#28 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/mexica...')
#29 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/mexica...')
#30 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#31 /home/mexicanos/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#32 /home/mexicanos/public_html/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#33 /home/mexicanos/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#34 /home/mexicanos/public_html/app/code/core/Mage/Catalog/controllers/CategoryController.php(161): Mage_Core_Controller_Varien_Action->renderLayout()
#35 /home/mexicanos/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_CategoryController->viewAction()
#36 /home/mexicanos/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#37 /home/mexicanos/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#38 /home/mexicanos/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#39 /home/mexicanos/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#40 /home/mexicanos/public_html/index.php(87): Mage::run('', 'store')
#41 {main}";s:3:"url";s:36:"/food/raw.html?dir=asc&order=newest";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}
但是,如果我使用任何其他选项,如价格,位置,名称,它是有效的。我已经花了2个小时寻找解决方案,似乎没有任何效果:我清除缓存,恢复旧数据库但仍然没有成功,我不明白为什么只有那个选项不起作用。任何帮助,将不胜感激。谢谢!
答案 0 :(得分:0)
我在其中检查了你的报告查询,查看
中查询中给出的引用(`)**ORDER BY FIELD(`e`.`entity_id`, -1) DESC, `created_at` DESC LIMIT 10**
答案 1 :(得分:0)
似乎你修改了Magento或一些插件,所以我不知道如何解决它。但在查询中#39; FIElD(e
entity_id, -1) DESC, created_at
&#39。这段不对。
请搜索此文本FIElD(e .
entity_id,-1)并将其删除。或者更简单,您可以回滚所有内容并尝试此解决方案,如果您想按最新的方式对产品进行排序
http://magebase.com/magento-tutorials/magento-sort-by-newest-products-made-easy/
答案 2 :(得分:0)
试用此扩展程序http://www.magentocommerce.com/magento-connect/sort-by-date.html。这可能会对你有帮助。
或者您可以使用“created_at”属性来完成。
http://yourdomain.com/category/sort-by/created_at/sort-direction/asc.html