【发布时间】:2015-08-11 12:43:25
【问题描述】:
其实
我在 CakePHP 2.2.2
的 AppController.php 中编写了这段代码class AppModel extends Model
{
function getLastQuery()
{
$dbo = $this->getDatasource();
$logs = $dbo->getLog();
$lastLog = end($logs['log']);
return $lastLog['query'];
}
}
我尝试了以下代码来打印输出查询
echo $this->AssetModel->getLastQuery();
$this->render('sql');
有没有人知道这一点的解决方案......?
【问题讨论】:
标签: cakephp-2.2