\common\core\CheckboxColumn::className(), 'name' => 'id', 'options' => ['width' => '20px;'], 'checkboxOptions' => function ($model, $key, $index, $column) { return ['value' => $key,'label'=>'','labelOptions'=>['class' =>'mt-checkbox mt-checkbox-outline','style'=>'padding-left:19px;']]; } ], [ 'header' => 'UID', 'attribute' => 'uid', 'options' => ['width' => '50px;'] ], [ 'header' => '用户名', 'attribute' => 'username', 'options' => ['width' => '100px;'] ], [ 'header' => '邮箱', 'attribute' => 'email', 'options' => ['width' => '150px;'] ], [ 'header' => '手机', 'attribute' => 'mobile', 'options' => ['width' => '150px;'] ], [ 'header' => '最后登录时间', 'attribute' => 'last_login_time', 'options' => ['width' => '150px;'], 'format' => ['date', 'php:Y-m-d H:i:s'] ], [ 'header' => '最后登录IP', 'attribute' => 'last_login_ip', 'options' => ['width' => '150px;'], 'content' => function($model){ return long2ip($model['last_login_ip']); } ], [ 'header' => '状态', 'attribute' => 'status', 'options' => ['width' => '60px;'], 'content' => function($model){ return $model['status'] ? '正常': '删除'; } ], [ 'class' => 'yii\grid\ActionColumn', 'header' => '操作', 'template' => '{edit} {auth}', 'options' => ['width' => '200px;'], 'buttons' => [ 'edit' => function ($url, $model, $key) { return Html::a(' 编辑', ['admin/edit','uid'=>$key], [ 'title' => Yii::t('app', '编辑'), 'class' => 'btn btn-xs blue' ]); }, 'auth' => function ($url, $model, $key) { return Html::a(' 授权', ['admin/auth','uid'=>$key], [ 'title' => Yii::t('app', '授权'), 'class' => 'btn btn-xs blue' ]); }, 'delete' => function ($url, $model, $key) { return Html::a('', ['admin/delete', 'id'=>$key], [ 'title' => Yii::t('app', '删除'), 'class' => 'btn btn-xs red ajax-get confirm' ]); } ], ], ]; ?>