Skip to content

Commit bb641d3

Browse files
fix
1 parent 8854193 commit bb641d3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/Filament/Resources/ReportResource/Actions/GenerateReport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ private function generateReport(array $data): void
354354
match ($type) {
355355
ReportType::POINTS => PointsReports::dispatch($report),
356356
ReportType::PROBLEMS => ProblemReports::dispatch($report),
357-
ReportType::USER_ACTIVITY => UserActivityReports::dispatch($report),
357+
// ReportType::USER_ACTIVITY => UserActivityReports::dispatch($report),
358358
ReportType::TOP_USERS => TopUsersReports::dispatch($report),
359359
};
360360
Notification::make()

app/Jobs/Reports/TopUsersReports.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Filament\Notifications\Actions\Action;
1414
use Filament\Notifications\Notification;
1515
use Illuminate\Contracts\Queue\ShouldQueue;
16-
use Illuminate\Database\Eloquent\Builder;
16+
use Illuminate\Database\Query\Builder;
1717
use Illuminate\Foundation\Queue\Queueable;
1818
use Illuminate\Support\Facades\DB;
1919

@@ -45,8 +45,8 @@ public function handle(): void
4545
->select([DB::raw('count(*) as total'), 'user_id'])
4646
->whereDate('created_at', '>=', $dates['start_date'])
4747
->whereDate('created_at', '<=', $dates['end_date'])
48-
->when($structure['contribution_type'] === 'points', fn (Builder $q) => $q->where('contribution_type', 'points'))
49-
->when($structure['contribution_type'] === 'problems', fn (Builder $q) => $q->where('contribution_type', 'problems'))
48+
->when($structure['contribution_type'] === 'points', fn (Builder $q) => $q->where('model_type', 'place'))
49+
->when($structure['contribution_type'] === 'problems', fn (Builder $q) => $q->where('model_type', 'problem'))
5050
->groupBy('user_id');
5151

5252
// $query = $query

0 commit comments

Comments
 (0)