1.在app\config\core.php中设置Configure::write('debug', 2);
2.页面上追加如下代码:$dbo = ConnectionManager::getDataSource('default');$logs = $dbo->getLog();$lastLog = end($logs['log']);echo $lastLog['query'];die;
本文共 252 字,大约阅读时间需要 1 分钟。
1.在app\config\core.php中设置Configure::write('debug', 2);
2.页面上追加如下代码:$dbo = ConnectionManager::getDataSource('default');$logs = $dbo->getLog();$lastLog = end($logs['log']);echo $lastLog['query'];die;
转载于:https://www.cnblogs.com/xiaobiaomei/p/9344652.html