Magento

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)
         );

一路走来,有你。

Write A Comment