返回捕获的 sql
<?php
/**
* fetchSql
*/
public function getSql()
{
return Db::table('wh_record')
->where([
['IDX', '>', 150000],
['UNIT', '=', 2],
['STATUS', 'IN', ['归还', '借出']],
])
->field('IDX AS ID, BUILD AS 阶段, ISN AS 序列号, STATUS AS 状态')
->order([
'IDX' => 'DESC',
'UNIT' => 'ASC'
])
->page(1, 10)
->fetchSql(true)
->select();
}