Ken пре 1 недеља
родитељ
комит
a62e4345e9
1 измењених фајлова са 4 додато и 3 уклоњено
  1. 4 3
      app/Http/Controllers/admin/Home.php

+ 4 - 3
app/Http/Controllers/admin/Home.php

@@ -9,6 +9,7 @@ use App\Services\PaymentOrderService;
 use Illuminate\Validation\ValidationException;
 use Exception;
 use Carbon\Carbon;
+use App\Models\Withdraw;
 
 class Home extends Controller
 {
@@ -30,15 +31,15 @@ class Home extends Controller
             $totalSuccess = (float)$query->where($where)->whereBetween('created_at', [$start, $end])->whereIn('status', [1, 2])->sum('amount');
             $totalFail = (float)$query->where($where)->whereBetween('created_at', [$start, $end])->where('status', 3)->sum('amount');
 
-
-
+            $query = Withdraw::query();
+           $usdTotalAmount =  $query->whereBetween('created_at', [$start, $end])->sum('amount');
 
 
             $result = [
                 'withdraw_usdt' => [
                     'total_fail' => $totalFail,
                     'total_success' => $totalSuccess,
-                    'total_amount' => $totalAmount,
+                    'total_amount' => $usdTotalAmount,
                 ],
                 'withdraw_rmb' => [
                     'total_fail' => $totalFail,