fix
This commit is contained in:
@@ -339,17 +339,17 @@ public function filters(Request $request)
|
||||
}
|
||||
$caseSql .= "WHEN duration > {$this->durationOtherMin()} THEN '120-' END";
|
||||
|
||||
$durations = Media::select(
|
||||
$durations = DB::table('media')
|
||||
->select(
|
||||
DB::raw("{$caseSql} as duration_range"),
|
||||
DB::raw('COUNT(*) as total')
|
||||
)
|
||||
->whereNotNull('duration')
|
||||
->where('duration', '>', 0) // every positive duration falls into a bucket
|
||||
->where(function ($q) {
|
||||
$q->where('visibility', 'public')
|
||||
->orWhere('user_id', auth()->id());
|
||||
})
|
||||
->groupBy('duration_range')
|
||||
->havingRaw('duration_range IS NOT NULL')
|
||||
->get();
|
||||
|
||||
return response()->json([
|
||||
|
||||
Reference in New Issue
Block a user