Ken 1 هفته پیش
والد
کامیت
b2e2301b12
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      app/Http/Controllers/admin/Withdraw.php

+ 5 - 1
app/Http/Controllers/admin/Withdraw.php

@@ -61,9 +61,13 @@ class Withdraw extends Controller
 
             $totalAmount = (float)$query->where($where)
                 ->whereDate('created_at', date('Y-m-d'))->sum('amount');
+           $totalSuccess = (float)$query->where($where)->whereDate('created_at', date('Y-m-d'))
+                ->whereIn('status', [1,2])->sum('amount');
 
 
-            $result = ['total_amount' => $totalAmount, 'total' => $count, 'data' => $list];
+
+
+            $result = ['totalSuccess'=>$totalSuccess,'total_amount' => $totalAmount, 'total' => $count, 'data' => $list];
         } catch (ValidationException $e) {
             return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
         } catch (Exception $e) {