mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-08-01 17:17:12 -04:00
Updated to latest
This commit is contained in:
@@ -188,28 +188,31 @@ class StudioPlusVideoController extends Controller
|
||||
$query->whereIn('studio_plus_category_id', $request->categories);
|
||||
})
|
||||
->when($request->filled('types'), function($query) use($request) {
|
||||
$types = array_map(function($item) {
|
||||
return strtoupper($item);
|
||||
}, $request->types);
|
||||
|
||||
$query->where(function($query) use($types) {
|
||||
for ($i = 0; $i < count($types); $i++) {
|
||||
$type = $types[$i];
|
||||
|
||||
if ($type == 'POV') {
|
||||
$query->orWhere(function($query) {
|
||||
$query->whereJsonLength('types', 0)->where('is_short', false);
|
||||
});
|
||||
} else {
|
||||
$query->orWhereJsonContains('types',[$type]);
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array('SHORTS', $types)) {
|
||||
$query->orWhere('is_short', true);
|
||||
}
|
||||
});
|
||||
$query->whereIn('studio_plus_video_type_id', $request->types);
|
||||
})
|
||||
// ->when($request->filled('types'), function($query) use($request) {
|
||||
// $types = array_map(function($item) {
|
||||
// return strtoupper($item);
|
||||
// }, $request->types);
|
||||
|
||||
// $query->where(function($query) use($types) {
|
||||
// for ($i = 0; $i < count($types); $i++) {
|
||||
// $type = $types[$i];
|
||||
|
||||
// if ($type == 'POV') {
|
||||
// $query->orWhere(function($query) {
|
||||
// $query->whereJsonLength('types', 0)->where('is_short', false);
|
||||
// });
|
||||
// } else {
|
||||
// $query->orWhereJsonContains('types',[$type]);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (in_array('SHORTS', $types)) {
|
||||
// $query->orWhere('is_short', true);
|
||||
// }
|
||||
// });
|
||||
// })
|
||||
->when($request->filled('asins'), function($query) use($request) {
|
||||
$query->whereIn('studio_plus_asin_id', $request->asins);
|
||||
})
|
||||
@@ -645,28 +648,31 @@ class StudioPlusVideoController extends Controller
|
||||
$query->whereIn('studio_plus_category_id', $request->categories);
|
||||
})
|
||||
->when($request->filled('types'), function($query) use($request) {
|
||||
$types = array_map(function($item) {
|
||||
return strtoupper($item);
|
||||
}, $request->types);
|
||||
|
||||
$query->where(function($query) use($types) {
|
||||
for ($i = 0; $i < count($types); $i++) {
|
||||
$type = $types[$i];
|
||||
|
||||
if ($type == 'POV') {
|
||||
$query->orWhere(function($query) {
|
||||
$query->whereJsonLength('types', 0)->where('is_short', false);
|
||||
});
|
||||
} else {
|
||||
$query->orWhereJsonContains('types',[$type]);
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array('SHORTS', $types)) {
|
||||
$query->orWhere('is_short', true);
|
||||
}
|
||||
});
|
||||
$query->whereIn('studio_plus_video_type_id', $request->types);
|
||||
})
|
||||
// ->when($request->filled('types'), function($query) use($request) {
|
||||
// $types = array_map(function($item) {
|
||||
// return strtoupper($item);
|
||||
// }, $request->types);
|
||||
|
||||
// $query->where(function($query) use($types) {
|
||||
// for ($i = 0; $i < count($types); $i++) {
|
||||
// $type = $types[$i];
|
||||
|
||||
// if ($type == 'POV') {
|
||||
// $query->orWhere(function($query) {
|
||||
// $query->whereJsonLength('types', 0)->where('is_short', false);
|
||||
// });
|
||||
// } else {
|
||||
// $query->orWhereJsonContains('types',[$type]);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (in_array('SHORTS', $types)) {
|
||||
// $query->orWhere('is_short', true);
|
||||
// }
|
||||
// });
|
||||
// })
|
||||
->when($request->filled('asins'), function($query) use($request) {
|
||||
$query->whereIn('studio_plus_asin_id', $request->asins);
|
||||
})
|
||||
@@ -900,6 +906,7 @@ class StudioPlusVideoController extends Controller
|
||||
$video->load([
|
||||
'thumbnail',
|
||||
'thumbnails',
|
||||
'videoType',
|
||||
'category',
|
||||
'asinData',
|
||||
'channel.user',
|
||||
|
||||
Reference in New Issue
Block a user