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')),
'main_table.entity_id = sbao.order_id',
array()
)->toString();
最佳答案
$select = $this->getSelect()->joinInner(
array('sbao' => $this->getTable('sales/billing_agreement_order')),
'main_table.entity_id = sbao.order_id',
array()
);
echo $select;
关于sql - 如何将 Magento sql 查询显示为字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4680116/