I have a model with complex relations which uses CDbCriteria for filtering data to be viewed in CGridView. I need to be able to export the filtered results also as a CSV file. For that, using ActiveRecords is too resource consuming (20000+ records), so it would be a lot faster to use CDbCommand to get the same results and export them.
The problem is, I cannot find a way to get the raw sql query that ActiveRecords builds from CDbCriteria. Does anyone know a way to do it?
关于构建查询的Yii 文档非常好。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.