全部。我正在尝试从数据库中获取所有订单项目,其中订单状态未“取消”。这是一段代码:
$items = Mage::getModel('sales/order_item')->getCollection();
$rents->getSelect()->join( array('sales_order'=>Mage::getSingleton('core/resource')->getTableName('sales/order')), Mage::getSingleton('core/resource')->getTableName('sales/order_item') . '.order_id = sales_order.entity_id', array('sales_order.state'));
$rents->addFilter('product_id', $productId);
$rents->addFilter('state', array('neq' => 'canceled'));
Dut,当我尝试运行此代码时,出现错误:“找不到列:1054 Unknown column 'sales_flat_order_item.order_id' in 'on Clause'”