|
...
|
...
|
@@ -93,7 +93,7 @@ class UserController extends BaseController |
|
|
|
return $this->response($validate->errors()->first(),Code::USER_PARAMS_ERROE,$this->param);
|
|
|
|
}
|
|
|
|
$userLogic = new UserLogic();
|
|
|
|
$rs = $userLogic->edit($this->param);
|
|
|
|
$rs = $userLogic->edits($this->param);
|
|
|
|
if($rs === false){
|
|
|
|
$this->response('参数错误或其他服务器原因,编辑失败',Code::USER_ERROR,[]);
|
|
|
|
}
|
|
...
|
...
|
@@ -101,6 +101,34 @@ class UserController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :修改当前用户状态
|
|
|
|
* @return void
|
|
|
|
* @author :liyuhang
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function status(){
|
|
|
|
//参数验证
|
|
|
|
$rules = [
|
|
|
|
'id'=>'required',
|
|
|
|
'status'=>'required',
|
|
|
|
];
|
|
|
|
//验证的提示信息
|
|
|
|
$message = [
|
|
|
|
'id.required'=>'主键必须填写',
|
|
|
|
'status.required'=>'状态必须填写',
|
|
|
|
];
|
|
|
|
$validate = Validator::make($this->param, $rules, $message);
|
|
|
|
if($validate->fails()){
|
|
|
|
return $this->response($validate->errors()->first(),Code::USER_PARAMS_ERROE,$this->param);
|
|
|
|
}
|
|
|
|
$userLogic = new UserModel();
|
|
|
|
$rs = $userLogic->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
if($rs === false){
|
|
|
|
$this->response('error',Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
$this->response($this->param['status'] == 0 ? '启用成功' : '禁用成功',Code::SUCCESS);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @name :删除管理员
|
|
|
|
* @return void
|
|
|
|
* @author :liyuhang
|
...
|
...
|
|