feat: spots
This commit is contained in:
parent
08010fbb61
commit
a4e1a3328f
20 changed files with 172 additions and 97 deletions
|
@ -30,11 +30,19 @@ class SmartBlockController extends Controller
|
|||
} else {
|
||||
$pagination = $request->per_page;
|
||||
}
|
||||
$smartblocks = SmartBlock::searchFilter($request)
|
||||
->with(['creator', 'tracks', 'tracks.file', 'criteria']);
|
||||
|
||||
return SmartBlock::searchFilter($request)
|
||||
->with(['creator', 'tracks', 'tracks.file', 'criteria'])
|
||||
if($request->has('smartblockType')) {
|
||||
$smartblockType = $request->get('smartblockType');
|
||||
$smartblocks = ($smartblockType == 'show')
|
||||
? $smartblocks->doesntHave('spotSmartblock')
|
||||
: $smartblocks->has('spotSmartblock');
|
||||
}
|
||||
|
||||
return $smartblocks
|
||||
->paginate($pagination)
|
||||
->toJson();show
|
||||
->toJson();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue