Ken 1 tydzień temu
rodzic
commit
7cc3950a3c
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6 1
      app/Http/Controllers/admin/Withdraw.php

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

@@ -58,7 +58,12 @@ class Withdraw extends Controller
                 ->orderBy('status')
                 ->orderByDesc('created_at')
                 ->forpage($page, $limit)->get();
-            $result = ['total' => $count, 'data' => $list];
+
+           $amountTotal = $query->where($where)->sum('amount');
+
+
+
+            $result = ['amount_total'=>$amountTotal,'total' => $count, 'data' => $list];
         } catch (ValidationException $e) {
             return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
         } catch (Exception $e) {