如何在平面目录产品数据打开时从magento EAV表中进行选择

Bla*_*azo 7 magento flat

我有这个代码从Magento选择最畅销的产品:

$productCollection = Mage::getResourceModel('reports/product_collection')
            ->addOrderedQty($startTime, $currentTime)
            ->addAttributeToSelect('*')
            ->setStoreId($storeId)
            ->addStoreFilter($storeId)
            ->setOrder('ordered_qty', 'desc')
            ->setPageSize($this->limit());
    }
Run Code Online (Sandbox Code Playgroud)

它工作正常,直到我在后端设置"使用平面目录产品"为是.有没有办法告诉magento不使用平台,而是使用EAV?
谁能帮我这个.

Ala*_*orm 9

创建一个新的模型类('mycatalog/product'),该类扩展原始产品类,但对其进行硬编码以使用EAV资源模型和EAV资源集合,然后在查询代码中使用该模型.