modified 禁止管理员被禁用

This commit is contained in:
zhaoxiang 2016-11-15 23:16:03 +08:00
parent 1ad68affed
commit 88040572b9

View File

@ -145,6 +145,7 @@ class User extends Base {
public function close(){
if( $this->request->isPut() ){
$id = $this->request->put($this->primaryKey);
if(!isAdministrator($id)){
$userObj = \app\admin\model\User::get([$this->primaryKey => $id]);
if( is_null($userObj) ){
$this->error('用户不存在','');
@ -153,6 +154,9 @@ class User extends Base {
$userObj->save();
$this->success('操作成功', url('User/index'));
}
}else{
$this->error('管理员不能被禁用','');
}
}
}