tp5返回sql语句
fetchSql用于直接返回SQL而不是执行查询,适用于任何的CURD操作方法
$result = Db::table('think_user')->fetchSql(true)->find(1);
输出result结果为:SELECT * FROM think_user where id = 1
世界上最美的风景,是自己努力的模样
fetchSql用于直接返回SQL而不是执行查询,适用于任何的CURD操作方法
$result = Db::table('think_user')->fetchSql(true)->find(1);
输出result结果为:SELECT * FROM think_user where id = 1