-1

这是我的查询,这给出了正确的输出。但是如何根据 magento 规则进行设置?

SELECT main_table.*, 
   (select company from sales_flat_order_address sfoa where sfoa.entity_id=sfo.billing_address_id) as bill_to_company,
   (select company from sales_flat_order_address sfoa where sfoa.entity_id=sfo.shipping_address_id) as ship_to_company
          FROM sales_flat_order_grid as main_table inner join sales_flat_order as sfo 
                    on main_table.entity_id = sfo.entity_id

请帮我....

感谢和问候 Praful

4

1 回答 1

1

您可以使用 magento 默认连接模型

$write = Mage::getSingleton('core/resource')->getConnection('core_write');

$result=$write->query("your query as like mysql query no different");

$row = $readresult->fetch(); // this will fetch all your data
于 2013-05-17T08:22:00.633 回答