\common\core\CheckboxColumn::className(), 'name' => 'id', 'options' => ['width' => '30px'], 'checkboxOptions' => function ($model, $key, $index, $column) { return ['value' => $key,'label'=>'','labelOptions'=>['class' =>'mt-checkbox mt-checkbox-outline','style'=>'padding-left:19px;']]; }, ],*/ ['class' => 'yii\grid\SerialColumn', 'headerOptions'=>['style'=>'width:2%;']], [ 'header' => '登录账号', 'attribute' => 'username', 'options' => ['width' => '80px'], 'filter' => Html::dropDownList('AdminSearch[from]', $searchModel->from, [ '' => '全部', 'backend' => '后台用户', 'fxee' => 'Fxee用户', ]), 'headerOptions'=>['style'=>'width:10px'], 'contentOptions' => ['style' => 'white-space: nowrap;'] ], [ 'label' => 'UID', 'attribute' => 'bind_uid', 'options' => ['width' => '70px'], ], [ 'label' => '真实姓名', 'attribute' => 'name.name', 'options' => ['width' => '80px'], ], // [ // 'label' => '后台角色', // 'attribute' => 'role', // 'options' => ['width' => '150px'], // 'contentOptions' => ['style' => 'white-space: nowrap;'], // 'content' => function($model){ // $DbManager = new \common\core\rbac\DbManager(); // $role = $DbManager->getRolesByUser($model['uid']); // if ($role && is_array($role)) { // $r = []; // foreach ($role as $key => $value) { // $r[] = $key; // } // /* 超级管理员判断 */ // if(Yii::$app->params['admin'] == $model['uid']){ // $r[] = '[超管]'; // return implode(', ', $r); // } // return implode(', ', $r); // } // return ''; // } // ], [ 'label' => 'fxee角色', 'attribute' => 'group.group', 'options' => ['width' => '80px'], ], [ 'header' => '状态', 'attribute' => 'status', 'options' => ['width' => '80px'], 'contentOptions' => ['style' => 'white-space: nowrap;'], 'content' => function($model){ return $model['status'] ? '
正常': ' 禁用'; } ], [ 'class' => 'yii\grid\ActionColumn', 'header' => '操作', 'template' => '{auth}', 'options' => ['width' => '120px'], 'contentOptions' => ['style' => 'white-space: nowrap;'], 'buttons' => [ 'auth' => function ($url, $model, $key) { return Html::a(' 分配角色', ['auth','uid'=>$key], [ 'title' => Yii::t('app', '分配角色'), 'class' => 'btn btn-xs btn-success' ]); } ], ], ]; ?>