0
全部。我試圖從數據庫中獲取所有訂單項目,其中訂單狀態未被「取消」。下面是一段代碼:Magento。未知列'sales_flat_order_item.order_id'
$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未知列在‘sales_flat_order_item.order_id’‘的條款’」下面的代碼