获取sql语句
- getLastSql
$res = Db::table('staff')->field('id,salary')->where('id','>',1)
->group('salary')->having('salary > 5000')->select();
$sql = Db::table('staff')->getLastSql();
halt($sql);
- select(false)
$res = Db::table('staff')->field('id,salary')->where('id','>',1)
->group('salary')->having('salary > 5000')->select(false);
halt($res);
- fetchSql
$res = Db::table('staff')->field('id,salary')->where('id','>',1)