From 08010fbb6117fb7d08d1a1f7a7b54b1b5a779359 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 4 Jul 2025 11:40:13 +0200 Subject: [PATCH] feat(BE): get show spot --- app/Http/Controllers/Show/ShowController.php | 16 ++++++++++++---- app/Http/Controllers/SmartBlockController.php | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Show/ShowController.php b/app/Http/Controllers/Show/ShowController.php index 0d44f98..db5f7e9 100644 --- a/app/Http/Controllers/Show/ShowController.php +++ b/app/Http/Controllers/Show/ShowController.php @@ -32,10 +32,18 @@ class ShowController extends Controller if(isset($request->per_page) || is_null($request)) { $pagination = $request->per_page; } - return Show::searchFilter($request) - ->orderBy('name') - ->paginate($pagination) - ->toJson(); + $shows = Show::searchFilter($request); + + if($request->has('showType')) { + $showType = $request->get('showType'); + $shows = ($showType == 'show') + ? $shows->doesntHave('spotShow') + : $shows->has('spotShow'); + } + + return $shows->orderBy('name') + ->paginate($pagination) + ->toJson(); } /** diff --git a/app/Http/Controllers/SmartBlockController.php b/app/Http/Controllers/SmartBlockController.php index aa68b4c..c5cdd57 100644 --- a/app/Http/Controllers/SmartBlockController.php +++ b/app/Http/Controllers/SmartBlockController.php @@ -34,7 +34,7 @@ class SmartBlockController extends Controller return SmartBlock::searchFilter($request) ->with(['creator', 'tracks', 'tracks.file', 'criteria']) ->paginate($pagination) - ->toJson(); + ->toJson();show } /**