【问题标题】:Magento admin dashboard errorMagento 管理仪表板错误
【发布时间】:2015-09-19 09:14:49
【问题描述】:
SQLSTATE [42S22]:未找到列:1054 未知列 'SUM((IFNULL(main_table.base_total_invoiced, 0) - IFNULL(main_table.base_tax_invoiced, 0) - IFNULL(main_table.base_shipping_invoiced, 0) - (IFNULL(main_table.base_total_refunded, 0) - IFNULL(ma' in 'field list',

查询是:

SELECT `SUM((IFNULL(main_table.base_total_invoiced, 0) -   
IFNULL(main_table.base_tax_invoiced, 0) - 
IFNULL(main_table.base_shipping_invoiced, 0) - 
(IFNULL(main_table.base_total_refunded, 0) - 
IFNULL(main_table.base_tax_refunded, 0) - 
IFNULL(main_table.base_shipping_refunded, 0))) * 
main_table`.`base_to_global_rate)` AS `lifetime`, 
`AVG((IFNULL(main_table.base_total_invoiced, 0) - 
IFNULL(main_table.base_tax_invoiced, 0) - 
IFNULL(main_table.base_shipping_invoiced, 0) - 
(IFNULL(main_table.base_total_refunded, 0) - 
IFNULL(main_table.base_tax_refunded, 0) - 
IFNULL(main_table.base_shipping_refunded, 0))) * 
main_table`.`base_to_global_rate)` AS `average` FROM 
`sales_flat_order` AS `main_table` WHERE (main_table.status NOT 
IN('canceled')) AND (main_table.state NOT IN('new', 
'pending_payment'))

当我打开 Magento 管理面板仪表板时,出现此错误。

提前致谢

【问题讨论】:

  • 您是在尝试调试 Magento 还是这是一个编码问题?

标签: magento


【解决方案1】:

查询出错,引号内不应包含sql函数。试试下面的查询。

SELECT SUM((
IFNULL(main_table.base_total_invoiced, 0) -   
IFNULL(main_table.base_tax_invoiced, 0) - 
IFNULL(main_table.base_shipping_invoiced, 0) - 
IFNULL(main_table.base_total_refunded, 0) - 
IFNULL(main_table.base_tax_refunded, 0) - 
IFNULL(main_table.base_shipping_refunded, 0))) * 
main_table.base_to_global_rate AS `lifetime`, 

AVG((
IFNULL(main_table.base_total_invoiced, 0) - 
IFNULL(main_table.base_tax_invoiced, 0) - 
IFNULL(main_table.base_shipping_invoiced, 0) - 
IFNULL(main_table.base_total_refunded, 0) - 
IFNULL(main_table.base_tax_refunded, 0) - 
IFNULL(main_table.base_shipping_refunded, 0))) * 
main_table.base_to_global_rate AS `average` 
FROM `sales_flat_order` AS `main_table`
WHERE (main_table.status NOT IN('canceled'))
AND (main_table.state NOT IN('new', 'pending_payment'))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-30
    • 2015-07-31
    • 2012-09-06
    • 2020-01-27
    • 2022-01-23
    • 2013-03-02
    • 1970-01-01
    • 2015-12-25
    相关资源
    最近更新 更多