多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
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方法,实现连贯操作子查询。