소스 검색

fix admin overview total credits counter

1day2die 2 년 전
부모
커밋
dd962a0afb
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/Http/Controllers/Admin/OverViewController.php

+ 1 - 1
app/Http/Controllers/Admin/OverViewController.php

@@ -38,7 +38,7 @@ class OverViewController extends Controller
         $counters = collect();
         //Set basic variables in the collection
         $counters->put('users', User::query()->count());
-        $counters->put('credits', number_format(User::query()->where('role', '!=', 'admin')->sum('credits'), 2, '.', ''));
+        $counters->put('credits', number_format(User::query()->whereHas("roles", function($q){ $q->where("id", "!=", "1"); })->sum('credits'), 2, '.', ''));
         $counters->put('payments', Payment::query()->count());
         $counters->put('eggs', Egg::query()->count());
         $counters->put('nests', Nest::query()->count());