请问一下 Yii 2.0 如何打印 SQL 语句调试呢?谢谢大佬
举个例子
$informationQuery = Information::find()->where(['>','is_check',0]); $informationList = $informationQuery->asArray()->all(); $sql = $informationQuery->createCommand()->getRawSql() ; // $informationList 为查询结果。 // $sql为执行的 SQL 语句。 echo $sql;die;
debug
->createCommand()->getRawSql()