一:

$con = Yii::$app->db;
$rel = $con->createCommand("select * from user");//预处理对象
$re = $rel->queryAll();//执行SQL查询动作

05-26 19:38