Magento构造它的SQL查询,如
$this->getSelect()->joinInner( array('sbao' => $this->getTable('sales/billing_agreement_order')),'main_table.entity_id = sbao.order_id',array() )
有没有办法以字符串格式显示结果查询,而不是打印出巨大的对象,例如
echo $this->getSelect()->joinInner( array('sbao' => $this->getTable('sales/billing_agreement_order')),array() )->toString();
解决方法
$select = $this->getSelect()->joinInner( array('sbao' => $this->getTable('sales/billing_agreement_order')),array() ); echo $select;