编写单位管理
This commit is contained in:
1 parent
36000b876c
commit
25cc4897eb
16 files changed
+654
-106
No files matched your search
@@ -114,7 +114,7 @@ class Index extends Base
|
||||
|
||||
|
||||
// 获取表单数据
|
||||
$list = request()->only(['xingming','username','sex','shengri','phone','beizhu'],'post');
|
||||
$list = request()->only(['xingming','username','sex','shengri','phone','beizhu','group_id'],'post');
|
||||
|
||||
// 设置密码,默认为123456
|
||||
$list['password'] = $md5->hash('123456');
|
||||
@@ -124,6 +124,9 @@ class Index extends Base
|
||||
$result = $validate->check($list);
|
||||
$msg = $validate->getError();
|
||||
|
||||
unset($list['group_id']);
|
||||
|
||||
|
||||
|
||||
// 如果验证不通过则停止保存
|
||||
if(!$result){
|
||||
|
||||
@@ -15,6 +15,7 @@ class Admin extends Validate
|
||||
protected $rule = [
|
||||
'xingming|用户姓名' => 'require|chs|length:2,6',
|
||||
'username|帐号' => ['require','uset'=>'/^[a-z][a-z0-9-_]*$/'],
|
||||
'group_id|角色' => 'require|number',
|
||||
'shengri|出生日期' => 'date',
|
||||
'xingbie|性别' => 'in:0,1,2',
|
||||
'phone|手机' => 'mobile',
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
{php}
|
||||
$group = db('auth_group')->where('status',true)->field('id,title')->all();
|
||||
{/php}
|
||||
{volist name="group" id="vo"}
|
||||
{volist name="group" id="vo" key="k"}
|
||||
<div class="radio-box">
|
||||
<input name="group_id" type="radio" id="group{$vo.id}" value="{$vo.id}">
|
||||
<input name="group_id" type="radio" id="group{$vo.id}" value="{$vo.id}" {eq name="$k" value="1" }required="true"{/eq}>
|
||||
<label for="group{$vo.id}">{$vo.title}</label>
|
||||
</div>
|
||||
{/volist}
|
||||
@@ -31,7 +31,7 @@
|
||||
<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>性别:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9 skin-minimal">
|
||||
<div class="radio-box">
|
||||
<input name="sex" type="radio" id="sex-1" value="1">
|
||||
<input name="sex" type="radio" id="sex-1" value="1" required="true">
|
||||
<label for="sex-1">男</label>
|
||||
</div>
|
||||
<div class="radio-box">
|
||||
@@ -97,9 +97,6 @@
|
||||
ustr:true,
|
||||
rangelength:[5,20]
|
||||
},
|
||||
group_id:{
|
||||
required:true,
|
||||
},
|
||||
sex:{
|
||||
required:true,
|
||||
},
|
||||
|
||||
Loaded 3 of 16 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user