feat: spots
This commit is contained in:
parent
08010fbb61
commit
a4e1a3328f
20 changed files with 172 additions and 97 deletions
|
@ -27,11 +27,17 @@ class FileController extends Controller
|
|||
$pagination = $request->per_page;
|
||||
}
|
||||
|
||||
return File::searchFilter($request)
|
||||
->where('import_status', '=', 0)
|
||||
->with('track_type')
|
||||
->with('owner')
|
||||
->orderBy('artist_name')
|
||||
$files = File::searchFilter($request)
|
||||
->where('import_status', '=', 0)
|
||||
->with('track_type')
|
||||
->with('owner');
|
||||
|
||||
if($request->track_type == 'spot'){
|
||||
$trackTypes = TrackType::where('code', '=', 'SPOT')->orWhere('parent_id', '=', '3')->pluck('id');
|
||||
$files = $files->whereIn('track_type_id', $trackTypes->toArray());
|
||||
}
|
||||
|
||||
return $files->orderBy('artist_name')
|
||||
->paginate($pagination)
|
||||
->toJson();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue