我的magento版本是1.9.1.0 我是Magento的新人。 这是我将local.xml.sample更改为local.xml后得到的错误消息
Error in file: "C:\wamp\www\magento\app\code\core\Mage\Sales\data\sales_setup\data-upgrade-1.6.0.4-1.6.0.5.php" - SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main.base_tax_refunded' in 'field list', query was: UPDATE `sales_flat_order_item` AS `main`
INNER JOIN (SELECT SUM(citem.row_total) AS `amount_refunded`, SUM(citem.base_row_total) AS `base_amount_refunded`, SUM(citem.base_tax_amount) AS `base_tax_refunded`, SUM(citem.discount_amount) AS `discount_refunded`, SUM(citem.base_discount_amount) AS `base_discount_refunded`, `oitem`.`item_id` FROM `sales_flat_creditmemo_item` AS `citem`
LEFT JOIN `sales_flat_creditmemo` AS `c` ON c.entity_id = citem.parent_id
LEFT JOIN `sales_flat_order` AS `o` ON o.entity_id = c.order_id
LEFT JOIN `sales_flat_order_item` AS `oitem` ON oitem.order_id = o.entity_id AND oitem.product_id=citem.product_id GROUP BY `oitem`.`item_id`) AS `selected`
SET `main`.`amount_refunded` = `selected`.`amount_refunded`, `main`.`base_amount_refunded` = `selected`.`base_amount_refunded`, `main`.`base_tax_refunded` = `selected`.`base_tax_refunded`, `main`.`discount_refunded` = `selected`.`discount_refunded`, `main`.`base_discount_refunded` = `selected`.`base_discount_refunded`
WHERE (main.item_id = selected.item_id)
跟踪:
#0 C:\wamp\www\magento\app\code\core\Mage\Core\Model\Resource\Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 C:\wamp\www\magento\app\code\core\Mage\Core\Model\Resource\Setup.php(407): Mage_Core_Model_Resource_Setup->_modifyResourceDb('data-upgrade', '1.6.0.0', '1.6.0.8')
#2 C:\wamp\www\magento\app\code\core\Mage\Core\Model\Resource\Setup.php(286): Mage_Core_Model_Resource_Setup->_upgradeData('1.6.0.0', '1.6.0.8')
#3 C:\wamp\www\magento\app\code\core\Mage\Core\Model\Resource\Setup.php(269): Mage_Core_Model_Resource_Setup->applyDataUpdates()
#4 C:\wamp\www\magento\app\code\core\Mage\Core\Model\App.php(351): Mage_Core_Model_Resource_Setup::applyAllDataUpdates()
#5 C:\wamp\www\magento\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#6 C:\wamp\www\magento\index.php(87): Mage::run('', 'store')
#7 {main}
请帮帮我....
答案 0 :(得分:0)
这意味着表main
没有列base_tax_refunded
。由于base_tax_refunded
是虚拟列,因此您需要将其放在HAVING
中,而不是WHERE
SELECT SUM(citem.base_tax_amount) AS `base_tax_refunded` HAVING `base_tax_refunded` = 'SomeValue'