StatController.php 927 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use Illuminate\Http\Request;
  4. use App\Http\Controllers\Controller;
  5. use App\Models\ServerGroup;
  6. use App\Models\Server;
  7. use App\Models\Plan;
  8. use App\Models\User;
  9. use App\Models\Ticket;
  10. use App\Models\Order;
  11. use Illuminate\Support\Facades\Cache;
  12. class StatController extends Controller
  13. {
  14. public function getOverride(Request $request)
  15. {
  16. return response([
  17. 'data' => [
  18. 'month_income' => Cache::get('month_income'),
  19. 'month_register_total' => Cache::get('month_register_total'),
  20. 'ticket_pendding_total' => Ticket::where('status', 0)
  21. ->count(),
  22. 'commission_pendding_total' => Order::where('commission_status', 0)
  23. ->where('invite_user_id', '!=', NULL)
  24. ->where('status', 3)
  25. ->count(),
  26. ]
  27. ]);
  28. }
  29. }