up
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
.idea
|
||||
|
||||
runtime
|
||||
/config/db.php
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
@@ -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('状态修改成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user