all(), [ "gid" => "required|integer|min:1", "uid" => "required|integer|min:1", ]); if ($validator->fails()) { return $this->fail(REQUEST_PARAM_ERROR, $this->error[REQUEST_PARAM_ERROR], $validator->errors()); } $currentUid = 0; // 判断当前用户是否可以为群组添加用户 $gid = (int)$request->input("gid"); $uid = (int)$request->input("uid"); $groupUser = new Models\GroupUser(); $result = $groupUser->GroupAddUser($gid, $uid); if ($result["code"] == 0) { return $this->success($result["data"]); } return $this->fail($result["code"], $this->error[$result["code"]]); } public function GroupRemoveUser(Request $request) { $validator = Validator::make($request->all(), [ "id" => "required|integer|min:1", ]); if ($validator->fails()) { return $this->fail(REQUEST_PARAM_ERROR, $this->error[REQUEST_PARAM_ERROR], $validator->errors()); } $currentUid = 0; // 判断当前用户是否可以为群组刪除用户 $id = (int)$request->input("id"); $groupUser = new Models\GroupUser(); $code = $groupUser->GroupRemoveUser($id); return $this->response($code, $this->error[$code]); } }