v2board/app/Http/Controllers/Admin/StatController.php

33 lines
897 B
PHP
Raw Normal View History

2019-12-18 18:08:52 +08:00
<?php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\ServerGroup;
use App\Models\Server;
use App\Models\Plan;
use App\Models\User;
use App\Models\Ticket;
use App\Models\Order;
use Cache;
2019-12-18 18:08:52 +08:00
2019-12-23 18:46:37 +08:00
class StatController extends Controller
2019-12-18 18:08:52 +08:00
{
2019-12-23 18:46:37 +08:00
public function getOverride (Request $request) {
2019-12-18 18:08:52 +08:00
return response([
'data' => [
'month_income' => Cache::get('month_income'),
'month_register_total' => Cache::get('month_register_total'),
2019-12-18 18:08:52 +08:00
'ticket_pendding_total' => Ticket::where('status', 0)
->count(),
'commission_pendding_total' => Order::where('commission_status', 0)
2019-12-18 18:14:26 +08:00
->where('invite_user_id', '!=', NULL)
->where('status', 3)
2019-12-18 18:08:52 +08:00
->count(),
2019-12-18 18:08:52 +08:00
]
]);
}
}