Yii::$app->dbName->createCommand($sql)->queryAll(); 指定dbName数据库配置 转载于:https://www.cnblogs.com/niuben/p/10755552.html