thinkphp5 打印sql语句,用于调试sql

$res = Db::name('CmsArchives')->getLastSql();

echo $res;

原文地址:https://www.cnblogs.com/cn-oldboy/p/12985053.html