callApiService = $callApiService; } public function putMainMenu() { $data = $this->callApiService->callApi([ 'url' => 'igroup-page', 'data' => [ 'PageVars' => [ 'Limit' => 9999999, 'Offset' => 0 ] ], ]); if ($data['Page']) { $mainMenuList = Utils::formatIgroupMenuList($data['Page'], 'IgroupCode'); $fullFileUrl = "dabory-footage/basic/igroup.json"; Storage::put($fullFileUrl, json_encode($mainMenuList)); } } public function putEtcBrand() { $data = $this->callApiService->callApi([ 'url' => 'etc-page', 'data' => [ 'Query' => "status = '0' and select_name = 'brand'", 'PageVars' => [ 'Limit' => 100000, ] ] ]); if ($data['Page']) { $fullFileUrl = "dabory-footage/basic/etc/brand.json"; Storage::put($fullFileUrl, json_encode($data)); } } public function putSetup() { $data = $this->callApiService->callApi([ 'url' => 'setup-page', 'data' => [ 'PageVars' => [ 'Limit' => 9999999, 'Offset' => 0 ] ], ]); if ($data['Page']) { foreach ($data['Page'] as $setup) { $setupCode = $setup['SetupCode']; $brandCode = $setup['BrandCode'] ? '-'.$setup['BrandCode'] : $setup['BrandCode']; $fullFileUrl = "dabory-footage/basic/setup/$setupCode$brandCode.json"; Storage::put($fullFileUrl, json_encode($setup)); } } } public function get($fullFileUrl) { if (Storage::disk()->exists($fullFileUrl)) { return json_decode(Storage::get($fullFileUrl), true); } return null; } public function getSetup($setupCode, $brandCode = null) { $brandCode = $brandCode ? '-'.$brandCode : $brandCode; $fullFileUrl = "dabory-footage/basic/setup/$setupCode$brandCode.json"; if (Storage::disk()->exists($fullFileUrl)) { $setup = json_decode(Storage::get($fullFileUrl), true); return json_decode($setup['SetupJson'], true); } return null; } }