Initial commit,修正
This commit is contained in:
Executable
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\bootstrap\Alert;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\User */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
$params = Yii::$app->params;
|
||||
|
||||
?>
|
||||
|
||||
<div class="user-form">
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'username')->textInput(['maxlength' => true]) ?>
|
||||
<?php
|
||||
if( Yii::$app->getSession()->hasFlash('error') ) {
|
||||
echo Alert::widget([
|
||||
'options' => [
|
||||
'class' => 'alert alert-danger',
|
||||
],
|
||||
'body' => Yii::$app->getSession()->getFlash('error'),
|
||||
]);
|
||||
}
|
||||
?>
|
||||
<?= $form->field($model, 'avatar')->textInput(['value'=>'@web/img/profile_small.png'])->label('头像')?>
|
||||
<?= $form->field($model, 'auth_key')->textInput(['maxlength' => true,'value'=>$params['defaultAdminPassword']]) ?>
|
||||
|
||||
<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<?= $form->field($model, 'mobile')->textInput(['label' => '']) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? '新增' : '更新', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\User */
|
||||
|
||||
$this->title = '新增会员';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Member', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="user-create">
|
||||
<div class="ibox-content">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<hr/>
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = '会员中心';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="user-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Create User', ['create'], ['class' => 'btn btn-success']) ?>
|
||||
</p>
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
'id',
|
||||
'username',
|
||||
'auth_key',
|
||||
'password_hash',
|
||||
'password_reset_token',
|
||||
// 'email:email',
|
||||
// 'role',
|
||||
// 'status',
|
||||
// 'created_at',
|
||||
// 'updated_at',
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
||||
Executable
+91
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @Author: fm453
|
||||
* @Date: 2021-09-08 12:10:51
|
||||
* @Last Modified by: fm453
|
||||
* @Last Modified time: 2021-09-09 03:03:02
|
||||
* @Email: fm453@lukegzs.com
|
||||
*/
|
||||
/* @var $this yii\web\View */
|
||||
use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use yii\widgets\LinkPager;
|
||||
|
||||
$this->title = '会员列表';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<h1><?= Html::encode($this->title) ?> 【共计 <kbd><code> <?= $count?> </code></kbd>人】</h1>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<a class="btn btn-info btn-sm" href="<?= Url::toRoute('create')?>">添加会员</a>
|
||||
</div>
|
||||
<form action="<?=Url::toRoute('list')?>" method="post">
|
||||
<input type="hidden" name="_csrf-backend" value="<?= Yii::$app->getRequest()->getCsrfToken();?>" />
|
||||
<div class="col-sm-3 pull-right">
|
||||
<div class="input-group">
|
||||
<input type="text" placeholder="搜手机号" name="search[mobile]" class="input-sm form-control" value="<?= isset($search['mobile'])?$search['mobile']:''; ?>"> <span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 pull-right">
|
||||
<input type="text" placeholder="搜用户名" name="search[username]" class="input-sm form-control" value="<?= isset($search['username'])?$search['username']:''; ?>">
|
||||
</div>
|
||||
<div class="col-sm-3 pull-right">
|
||||
<input type="text" placeholder="搜邮箱" name="search[email]" class="input-sm form-control" value="<?= isset($search['email'])?$search['email']:''; ?>">
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>名称</th>
|
||||
<th>手机</th>
|
||||
<th>邮箱</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach($member as $vo):?>
|
||||
<tr>
|
||||
<td><?=$vo['id']?></td>
|
||||
<td><img src="<?=Url::to($vo['avatar'])?>" alt="" style="width:40px;height:40px;"><?=$vo['username']?></td>
|
||||
<td><?=$vo['mobile']?></td>
|
||||
<td><?=$vo['email']?></td>
|
||||
<td><?=$status[$vo['status']]?></td>
|
||||
<td>
|
||||
<a class="btn btn-primary btn-xs" href="<?=Url::toRoute(['update','id'=>$vo['id']])?>"><i class="fa fa-edit"></i>编辑</a>
|
||||
<?php if($vo['status']==0):?><a href="<?=Url::toRoute(['status','status'=>1,'id'=>$vo['id']])?>" class="btn btn-warning btn-xs"><i class="fa fa-unlock"></i>恢复</a><?php endif;?>
|
||||
<?php if($vo['status']==1):?><a href="<?=Url::toRoute(['status','status'=>0,'id'=>$vo['id']])?>" class="btn btn-danger btn-xs"><i class="fa fa-lock"></i>禁用</a><?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<!--分页-->
|
||||
<div class="f-r">
|
||||
<?= LinkPager::widget([
|
||||
'pagination'=>$pages,
|
||||
'firstPageLabel' => '首页',
|
||||
'nextPageLabel' => '下一页',
|
||||
'prevPageLabel' => '上一页',
|
||||
'lastPageLabel' => '末页',
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\AuthItem */
|
||||
|
||||
$this->title = '更新会员';
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox-content">
|
||||
<div class="row pd-4">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<hr>
|
||||
<div class="auth-item-form col-sm-4">
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'id')->hiddenInput()->label('')?>
|
||||
|
||||
<?= $form->field($model, 'username')->textInput()->label('会员名称') ?>
|
||||
|
||||
<?= $form->field($model, 'avatar')->textInput(['placeholder'=>'@web/img/profile_small.png'])->label('头像')?>
|
||||
|
||||
<?= $form->field($model, 'email')->textInput(['placeholder'=>'','readonly'=>true])->label('邮箱')?>
|
||||
<?= $form->field($model, 'mobile')->textInput(['placeholder'=>'','readonly'=>true])->label('手机号')?>
|
||||
|
||||
<?= $form->field($model, 'auth_key_new')->textInput(['value'=>''])->label('密码')?>
|
||||
<?= $form->field($model, 'auth_key')->hiddenInput()->label(false)?>
|
||||
|
||||
<?= $form->field($model, 'status' )->dropDownList($status,['disabled'=>false])->label('状态')?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('保存', ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\User */
|
||||
|
||||
$this->title = $model->id;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="user-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => 'Are you sure you want to delete this item?',
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'username',
|
||||
'auth_key',
|
||||
'password_hash',
|
||||
'password_reset_token',
|
||||
'email:email',
|
||||
'role',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user