gpt4 book ai didi

php - 一页 magento 网站出现问题

转载 作者:行者123 更新时间:2023-11-29 21:42:41 24 4
gpt4 key购买 nike

我使用 Magento 中的市场 CED 扩展开发了市场网站。我的网站几天前运行良好,但现在我在供应商商店页面中遇到奇怪的问题,它显示错误,网站的其余部分运行良好。当我打开页面时显示语法错误

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1=1 AND ( e.website_id = '1' ) AND ( e.customer_group_id = '1') AND (e.min_price' at line 2

查询是:

SELECT FLOOR((ROUND((e.min_price) * 1, 2)) / 100) + 1 AS `range`, COUNT(*) AS `count` 
FROM `mage_catalog_product_index_price` 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 = '2'
WHERE 1=1
AND (e.entity_id IN('1749', '1750', '1751', '1752', '1753', '1754', '1755', '1756', '1757', '1758', '1759', '1760', '1761', '1762', '1763', '1764', '1765', '1766', '1767', '1768', '1769', '1770', '1771', '1772', '1773', '1774', '1775', '1776', '1777', '1778', '1779', '1780', '1781', '1782', '1783', '1784', '1785', '1786', '1787', '1788', '1789', '1790', '1791', '1792', '1793', '1794', '1795', '1796', '1797', '1798', '1799', '1800', '1801', '1802', '1803', '1804', '1805', '1806', '1807', '1809', '1810', '1811', '1812', '1813', '1814', '1815', '1816', '1817', '1818', '1819', '1820', '1821', '1822', '1824', '1825', '1826', '1827', '1828', '1829', '1830', '1831', '1832', '1833', '1834', '1836', '1837', '1838', '1839', '1840', '1841', '1842', '1843', '1844', '1845', '1846', '1847', '1848', '1849', '1850', '1851', '1852', '1853', '1854', '1855', '1856', '1876', '1877', '1878', '1879', '1880', '1881', '1882', '1892', '1893', '1894', '1895', '1896', '1897', '1898', '1899', '1900', '1901', '1902', '1903', '1904', '1905')) 1=1
AND ( e.website_id = '1' )
AND ( e.customer_group_id = '1')
AND (e.min_price IS NOT NULL)
GROUP BY FLOOR((ROUND((e.min_price) * 1, 2)) / 100) + 1
ORDER BY FLOOR((ROUND((e.min_price) * 1, 2)) / 100) + 1 ASC

谁能告诉我问题出在哪里

最佳答案

删除 1=1 两次(第一次在 WHERE 之后,第二次在 IN 列表之后):

SELECT FLOOR((ROUND((e.min_price) * 1, 2)) / 100) + 1 AS range,
COUNT(*) AS COUNT
FROM mage_catalog_product_index_price AS e
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 = '2'
WHERE e.entity_id IN('1749', '1750', '1751', '1752', '1753', '1754', '1755', '1756', '1757', '1758', '1759', '1760', '1761', '1762', '1763', '1764', '1765', '1766', '1767', '1768', '1769', '1770', '1771', '1772', '1773', '1774', '1775', '1776', '1777', '1778', '1779', '1780', '1781', '1782', '1783', '1784', '1785', '1786', '1787', '1788', '1789', '1790', '1791', '1792', '1793', '1794', '1795', '1796', '1797', '1798', '1799', '1800', '1801', '1802', '1803', '1804', '1805', '1806', '1807', '1809', '1810', '1811', '1812', '1813', '1814', '1815', '1816', '1817', '1818', '1819', '1820', '1821', '1822', '1824', '1825', '1826', '1827', '1828', '1829', '1830', '1831', '1832', '1833', '1834', '1836', '1837', '1838', '1839', '1840', '1841', '1842', '1843', '1844', '1845', '1846', '1847', '1848', '1849', '1850', '1851', '1852', '1853', '1854', '1855', '1856', '1876', '1877', '1878', '1879', '1880', '1881', '1882', '1892', '1893', '1894', '1895', '1896', '1897', '1898', '1899', '1900', '1901', '1902', '1903', '1904', '1905')
AND e.website_id = '1'
AND e.customer_group_id = '1'
AND e.min_price IS NOT NULL
GROUP BY FLOOR((ROUND((e.min_price) * 1, 2)) / 100) + 1
ORDER BY range ASC

关于php - 一页 magento 网站出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34368761/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com