title = 'Сотрудники'; $this->params['breadcrumbs'][] = $this->title; ?>
= Html::a('Назначить менеджеру работника', ['create'], ['class' => 'btn btn-success']) ?>
= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], [ 'attribute' => 'manager_id', 'filter' => User::find()->select(['username', 'user.id']) ->joinWith('manager')->where(['not',['manager.user_id' => null]])->indexBy('user.id')->column(), 'value' => 'manager.user.username', ], [ 'attribute' => 'employee_id', 'filter' => User::find()->select(['username', 'user.id']) ->joinWith('manager')->where(['manager.user_id' => null])->indexBy('user.id')->column(), 'value' => 'user.username', ], ['class' => 'yii\grid\ActionColumn'], ], ]); ?>