Magento中直接使用select加表名查询数据的方法

 $resource       = Mage::getSingleton('core/resource');
 $readConnection = $resource->getConnection('core_read');
 $data           = $readConnection->fetchRow(
             $readConnection->select()
                 ->from('amasty_storecredit_customer_balance')   //表名
                 ->where('website_id = ?', $websiteId)
                 ->where('customer_id = ?', $customerId)
                 ->limit(1)
         );

Leave a Reply

您的邮箱地址不会被公开。 必填项已用 * 标注