$query=$sql->where([ 'test_id'=>24, 'name'=>'小洋' ]); //打印sql; $query->prepare(Yii::$app->db->queryBuilder)->createCommand()->rawSql;; 来自为知笔记(Wiz)