当表“ reserva”的id_alumno等于已登录的id_alumno时,我想显示此列表的行。
-表储备金
-GridView储备\索引
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
'fecha',
//['class' => 'yii\grid\ActionColumn'],
],
]); ?>
答案 0 :(得分:0)
在其他“ andFilterWhere”后面的“搜索”函数中的“ ReservaSearch.php”中添加它
$query->andFilterWhere(['id_alumno' => \Yii::$app->user->id]);
答案 1 :(得分:0)
$dataProvider->query->where('reserva == id_alumno ')
您可以在Gridview窗口小部件中添加查询