Ken 1 неделя назад
Родитель
Сommit
8ea4d6cfef
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      app/Http/Controllers/admin/Home.php

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

@@ -32,13 +32,15 @@ class Home extends Controller
             $totalFail = (float)$query->where($where)->whereBetween('created_at', [$start, $end])->where('status', 3)->sum('amount');
 
             $query = Withdraw::query();
-           $usdTotalAmount =  (float)$query->whereBetween('created_at', [$start, $end])->sum('amount');
+            $usdTotalAmount = (float)$query->whereBetween('created_at', [$start, $end])->sum('amount');
+            $usdTotalSuccess = (float)$query->where('status',1)->whereBetween('created_at', [$start, $end])->sum('amount');
+            $usdTotalFail = (float)$query->where('status',2)->whereBetween('created_at', [$start, $end])->sum('amount');
 
 
             $result = [
                 'withdraw_usdt' => [
-                    'total_fail' => $totalFail,
-                    'total_success' => $totalSuccess,
+                    'total_fail' => $usdTotalFail,
+                    'total_success' => $usdTotalSuccess,
                     'total_amount' => $usdTotalAmount,
                 ],
                 'withdraw_rmb' => [