作者 sgj

用户管理

... ... @@ -162,4 +162,22 @@ class AdminIndexController extends AdminBaseController
return $this->fetch();
}
/**
* 编辑用户信息
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function userInfoPost(){
$map['id']=input('id');
dump($map);
$data=input();
unset($data['id']);
dump($data);
$result=\db('user')->where($map)->update($data);
if ($result==1){
$this->success('编辑成功!');
}else{
$this->error('编辑失败!');
}
}
}
... ...
... ... @@ -6,17 +6,17 @@
<li><a href="{:url('rbac/index')}">{:lang('ADMIN_RBAC_INDEX')}</a></li>
<li class="active"><a>编辑信息</a></li>
</ul>
<form class="form-horizontal js-ajax-form margin-top-20" action="{:url('')}" method="post">
<form class="form-horizontal js-ajax-form margin-top-20" action="{:url('userInfoPost')}" method="post">
<div class="form-group">
<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>用户姓名</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" id="input-name" name="name" value="{$user.user_login}">
<input type="text" class="form-control" id="input-name" name="user_login" value="{$user.user_login}">
</div>
</div>
<div class="form-group">
<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>用户昵称</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" id="input-name" name="name" value="{$user.user_nickname}">
<input type="text" class="form-control" id="input-name" name="user_nickname" value="{$user.user_nickname}">
</div>
</div>
... ... @@ -116,7 +116,7 @@
<div class="form-group">
<label for="input-remark" class="col-sm-2 control-label">所在平台</label>
<div class="col-md-6 col-sm-10">
<select class="form-control valid" name="hospital" id="input-site_adminstyle" aria-invalid="false">
<select class="form-control valid" name="platform" id="input-site_adminstyle" aria-invalid="false">
<volist name="platforms" id="vo">
<option value="{$vo.id}" selected="">{$vo.name}</option>
... ... @@ -127,6 +127,16 @@
</div>
<div class="form-group">
<label class="col-sm-2 control-label">状态</label>
<div class="col-md-6 col-sm-10">
<label class="radio-inline">
<input type="radio" name="user_type" value="1" <if condition="$user.user_type==2">checked</if> >普通用户</label>
<label class="radio-inline">
<input type="radio" name="user_type" value="0" <if condition="$user.user_type==3">checked</if> > 专家用户</label>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="hidden" name="id" value="{$user.id}"/>
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
... ...