mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 09:21:46 +08:00 
			
		
		
		
	update
This commit is contained in:
		| @@ -47,7 +47,7 @@ class SystemCache extends Command | |||||||
|  |  | ||||||
|     private function setMonthIncome() { |     private function setMonthIncome() { | ||||||
|         Redis::set( |         Redis::set( | ||||||
|             'getMonthIncome', |             'month_income', | ||||||
|             Order::where('created_at', '>', strtotime(date('Y-m-1'))) |             Order::where('created_at', '>', strtotime(date('Y-m-1'))) | ||||||
|                 ->where('created_at', '>', time()) |                 ->where('created_at', '>', time()) | ||||||
|                 ->where('status', '3') |                 ->where('status', '3') | ||||||
| @@ -58,7 +58,7 @@ class SystemCache extends Command | |||||||
|  |  | ||||||
|     private function setMonthRegisterTotal() { |     private function setMonthRegisterTotal() { | ||||||
|         Redis::set( |         Redis::set( | ||||||
|             'getMonthRegisterTotal', |             'month_register_total', | ||||||
|             User::where('created_at', '>', strtotime(date('Y-m-1'))) |             User::where('created_at', '>', strtotime(date('Y-m-1'))) | ||||||
|                 ->where('created_at', '>', time()) |                 ->where('created_at', '>', time()) | ||||||
|                 ->count() |                 ->count() | ||||||
|   | |||||||
| @@ -10,9 +10,16 @@ use App\Models\ServerGroup; | |||||||
| use App\Models\Server; | use App\Models\Server; | ||||||
| use App\Models\Plan; | use App\Models\Plan; | ||||||
| use App\Models\User; | use App\Models\User; | ||||||
|  | use Illuminate\Support\Facades\Redis; | ||||||
|  |  | ||||||
| class StatController extends Controller | class StatController extends Controller | ||||||
| { | { | ||||||
|     public function dashboard (Request $request) { |     public function dashboard (Request $request) { | ||||||
|  |         return response([ | ||||||
|  |             'data' => [ | ||||||
|  |                 'month_income' => Redis::get('month_income'), | ||||||
|  |                 'month_register_total' => Redis::get('month_register_total') | ||||||
|  |             ] | ||||||
|  |         ]); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user