- 修复更新后出现重复的默认组的bug
- 禁止删除默认组
This commit is contained in:
@@ -88,6 +88,9 @@ class Group extends Base
|
||||
Db::startTrans();
|
||||
try {
|
||||
$id = $this->request->post('id');
|
||||
if (1 == $id) {
|
||||
throw new Exception('默认组不可删除');
|
||||
}
|
||||
$group = GroupModel::find($id);
|
||||
// 至少保留一个默认分组
|
||||
$defaultId = GroupModel::where('default', 1)->where('id', 'neq', $id)->value('id');
|
||||
|
||||
Reference in New Issue
Block a user