From 01ac86156dce002b79f042e6e92c681263866245 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 16 Dec 2019 13:59:15 +0800 Subject: [PATCH] update --- app/Http/Controllers/Admin/UserController.php | 15 +++++++++++++++ routes/api.php | 1 + 2 files changed, 16 insertions(+) diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 8f804933..7fc2e33c 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -35,6 +35,21 @@ class UserController extends Controller ]); } + public function id2UserInfo ($id) { + if (empty($id)) { + abort(500, '参数错误'); + } + return response([ + 'data' => User::select([ + 'email', + 'u', + 'd', + 'transfer_enable', + 'expired_at' + ])->find($id) + ]); + } + public function update (UserUpdate $request) { $updateData = $request->only([ 'email', diff --git a/routes/api.php b/routes/api.php index 3ef2e8d8..c3982256 100755 --- a/routes/api.php +++ b/routes/api.php @@ -42,6 +42,7 @@ Route::prefix('v1') // User Route::get ('user', 'Admin\\UserController@index'); Route::post('user/update', 'Admin\\UserController@update'); + Route::get ('user/id2UserInfo/{id}', 'Admin\\UserController@id2UserInfo'); // Stat Route::get ('stat/dashboard', 'Admin\\StatController@dashboard'); // Notice