fix
This commit is contained in:
@@ -66,6 +66,12 @@ class Group extends Base
|
||||
if (true !== $validate) {
|
||||
throw new Exception($validate);
|
||||
}
|
||||
$data['default'] = array_key_exists('default', $data) ? 1 : 0;
|
||||
if ($data['default'] === 0) {
|
||||
if (!GroupModel::where('default', 1)->where('id', 'neq', $data['id'])->count()) {
|
||||
throw new Exception('至少保留一个默认分组');
|
||||
}
|
||||
}
|
||||
if (!GroupModel::update($data)) {
|
||||
throw new Exception('编辑失败');
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
<div class="mdui-dialog-title">添加角色组</div>
|
||||
<div class="mdui-textfield">
|
||||
<label class="mdui-textfield-label">组名称</label>
|
||||
<input class="mdui-textfield-input" type="text" name="name" value="" placeholder="用户名" autocomplete="off"/>
|
||||
<input class="mdui-textfield-input" type="text" name="name" value="" placeholder="组名称" autocomplete="off"/>
|
||||
</div>
|
||||
<div class="mdui-textfield">
|
||||
<label class="mdui-textfield-label">使用策略</label>
|
||||
|
||||
Reference in New Issue
Block a user