fix: something

This commit is contained in:
tokumeikoi
2021-02-17 17:11:17 +09:00
parent 7c40a146a9
commit cdddbae19a
4 changed files with 52 additions and 5 deletions

View File

@ -17,8 +17,13 @@ class UserController extends Controller
if (empty($request->input('id'))) {
abort(500, '参数错误');
}
$user = User::where('is_admin', 0)
->where('id', $request->input('id'))
->where('is_staff', 0)
->first();
if (!$user) abort(500, '用户不存在');
return response([
'data' => User::find($request->input('id'))
'data' => $user
]);
}