This commit is contained in:
wispx 2018-11-30 16:37:32 +08:00
parent 5483e64656
commit 7cac023bc8
3 changed files with 6 additions and 2 deletions

2
.env
View File

@ -1,4 +1,4 @@
[APP]
NAME = Lsky Pro
DEBUG = false
DEBUG = true
TRACE = false

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
.idea
runtime
/config/db.php
# Icon must end with two \r
Icon

View File

@ -122,10 +122,13 @@ class Users extends Base
if (!$user = UserModel::get($id)) {
return $this->error('数据获取失败');
}
if ($user->id === $this->user->id) {
return $this->error('不可修改自己的状态');
}
if (!$user->where('id', $id)->setField('state', $state)) {
return $this->error('状态修改失败');
}
return $this->success('状态修改成功');
}
}
}
}