企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
buildSQL方法返回SQL语句,不执行查询。 ~~~ $sql = $model->buildSQL(); echo $sql; ~~~ 输出结果: `select * from table` * * * * * ~~~ $sql = $model2->where(array('id'=>1))->buildSQL(); $model1->where('id = ('. $sql .')')->select(); ~~~ 执行的SQL语句:`select * from table1 where id = (select * from table2 where id=1)` 上面的代码是通过buildSQL方法,实现连贯操作子查询。