Ken 1 tydzień temu
rodzic
commit
5e27135b63
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      app/Http/Controllers/admin/Balance.php

+ 5 - 2
app/Http/Controllers/admin/Balance.php

@@ -30,8 +30,11 @@ class Balance extends Controller
             $query = BalanceLog::where(BalanceLogService::getWhere($params));
             $query = BalanceLog::where(BalanceLogService::getWhere($params));
             $data['total'] = $query->count();
             $data['total'] = $query->count();
             $totalAmount = '--';
             $totalAmount = '--';
-            if (isset($params['member_id']) && isset($params['change_type'])) $totalAmount = $query->sum('amount');
-            $data['total_amount'] = bcadd($totalAmount, 0, 2);
+            if (isset($params['member_id']) && isset($params['change_type'])) {
+                $totalAmount = $query->sum('amount');
+                $totalAmount = bcadd($totalAmount, 0, 2);
+            }
+            $data['total_amount'] =$totalAmount;
             $data['data'] = $query->orderByDesc('id')
             $data['data'] = $query->orderByDesc('id')
                 ->forPage($page, $limit)->with(['member'])
                 ->forPage($page, $limit)->with(['member'])
                 ->get()->toArray();
                 ->get()->toArray();