mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-10-08 03:13:26 -04:00
Updated to latest
This commit is contained in:
@@ -5,34 +5,21 @@ namespace Modules\StudioPlus\Http\Controllers;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Modules\Language\Repositories\LanguageRepository;
|
||||
|
||||
class GlobalSettingController extends Controller
|
||||
{
|
||||
protected $languagesRepository;
|
||||
|
||||
public function __construct(LanguageRepository $languagesRepository)
|
||||
{
|
||||
$this->languagesRepository = $languagesRepository;
|
||||
}
|
||||
|
||||
public function categories()
|
||||
{
|
||||
|
||||
\Modules\StudioPlus\Entities\StudioPlusVideo::whereNull('studio_plus_video_type_id')->chunkById(100, function ($videos) {
|
||||
foreach ($videos as $key => $video) {
|
||||
if(is_array($video->types)){
|
||||
if(count($video->types) == 0 && $video->is_short == 0){
|
||||
$video->studio_plus_video_type_id = 1;
|
||||
} else if(in_array("VIDEO BASED ON A JOB", $video->types) && $video->is_short == 0){
|
||||
$video->studio_plus_video_type_id = 2;
|
||||
} else if(in_array("REACH OUT", $video->types) && $video->is_short == 0){
|
||||
$video->studio_plus_video_type_id = 3;
|
||||
} else if(in_array("SPONSORED PRODUCT", $video->types)){
|
||||
$video->studio_plus_video_type_id = 4;
|
||||
} else if(count($video->types) == 0 && $video->is_short == 1){
|
||||
$video->studio_plus_video_type_id = 5;
|
||||
} else if(in_array("VIDEO BASED ON A JOB", $video->types) && $video->is_short == 1){
|
||||
$video->studio_plus_video_type_id = 6;
|
||||
}
|
||||
$video->save();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return view('studioplus::setting.category');
|
||||
$languages = $this->languagesRepository->getActiveAll();
|
||||
return view('studioplus::setting.category')->with('languages',$languages);
|
||||
}
|
||||
|
||||
public function paginations()
|
||||
|
||||
Reference in New Issue
Block a user