From 1a79a7e7f687f87ee788b89cdeb764a783490729 Mon Sep 17 00:00:00 2001 From: tokumeikoi Date: Fri, 21 Oct 2022 15:46:48 +0800 Subject: [PATCH] update: admin/stat/getOverride --- app/Http/Controllers/Admin/StatController.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Admin/StatController.php b/app/Http/Controllers/Admin/StatController.php index f99e3b6d..2f4a4528 100644 --- a/app/Http/Controllers/Admin/StatController.php +++ b/app/Http/Controllers/Admin/StatController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Admin; +use App\Models\CommissionLog; use App\Models\ServerShadowsocks; use App\Models\ServerTrojan; use App\Models\StatUser; @@ -47,14 +48,12 @@ class StatController extends Controller ->where('created_at', '<', strtotime(date('Y-m-1'))) ->whereNotIn('status', [0, 2]) ->sum('total_amount'), - 'commission_month_payout' => Order::where('actual_commission_balance' ,'!=', NULL) - ->where('created_at', '>=', strtotime(date('Y-m-1'))) + 'commission_month_payout' => CommissionLog::where('created_at', '>=', strtotime(date('Y-m-1'))) ->where('created_at', '<', time()) - ->sum('actual_commission_balance'), - 'commission_last_month_payout' => Order::where('actual_commission_balance' ,'!=', NULL) - ->where('created_at', '>=', strtotime('-1 month', strtotime(date('Y-m-1')))) + ->sum('get_amount'), + 'commission_last_month_payout' => CommissionLog::where('created_at', '>=', strtotime('-1 month', strtotime(date('Y-m-1')))) ->where('created_at', '<', strtotime(date('Y-m-1'))) - ->sum('actual_commission_balance'), + ->sum('get_amount'), ] ]); }