This commit is contained in:
root 2019-12-23 15:33:34 +08:00
parent 63dd8b9292
commit 1d15f8eb03
2 changed files with 17 additions and 0 deletions

View File

@ -87,6 +87,22 @@ class UserController extends Controller
]);
}
public function getStat (Request $request) {
$stat = [
Order::where('status', 0)
->where('user_id', $request->session()->get('id'))
->count(),
Ticket::where('status', 0)
->where('user_id', $request->session()->get('id'))
->count(),
User::where('invite_user_id', $request->session()->get('id'))
->count()
];
return response([
'data' => $stat
]);
}
public function getSubscribe (Request $request) {
$user = User::find($request->session()->get('id'));
$server = [];

View File

@ -68,6 +68,7 @@ Route::prefix('v1')
Route::post('changePassword', 'UserController@changePassword');
Route::post('update', 'UserController@update');
Route::get ('getSubscribe', 'UserController@getSubscribe');
Route::get ('getStat', 'UserController@getStat');
// Order
Route::get ('order', 'OrderController@index');
Route::post('order/save', 'OrderController@save');