diff --git a/app/Console/Commands/Grap.php b/app/Console/Commands/Grap.php index 3cc98f3c..ea06f527 100644 --- a/app/Console/Commands/Grap.php +++ b/app/Console/Commands/Grap.php @@ -56,6 +56,7 @@ class Grap extends Command switch (self::$options['id']) { case 1: + // DAILY SetStorage::set(1); // MoveToArchive::move(1); @@ -67,20 +68,24 @@ class Grap extends Command SendMail::run(1); break; - // case 2: - // SetStorage::set(); + case 2: + // DATE + // SetStorage::set(); - // Grapper::load(2); - // break; + // Grapper::load(2); + break; case 3: + // RANGE SetStorage::set(3); - // Grapper::load(3); + Grapper::load(3); MakeExcel::create(); break; case 4: + // ROSE + SetStorage::set(4); Rose::run(); diff --git a/app/Console/Commands/Grapper/Sofascore/Helper/SetStorage.php b/app/Console/Commands/Grapper/Sofascore/Helper/SetStorage.php index 6df0bd9d..86d54462 100644 --- a/app/Console/Commands/Grapper/Sofascore/Helper/SetStorage.php +++ b/app/Console/Commands/Grapper/Sofascore/Helper/SetStorage.php @@ -42,6 +42,7 @@ class SetStorage case 4: Grap::$storage = $sofascore_data . $storage_name; Grap::$folder = 'rosa-' . Carbon::now()->format('Y-m-d'); + Grap::$excel = Grap::$storage . '/rosa-' . Carbon::now()->format('Y-m-d'); break; case 5: Grap::$storage = $sofascore_data; @@ -54,8 +55,8 @@ class SetStorage } if ($debug) { - Notice::note(Grap::$folder, 'bb'); - Notice::note(Grap::$storage); + Notice::note(Grap::$folder, 'g'); + // Notice::note(Grap::$storage); sleep(4); } } diff --git a/app/Console/Commands/Grapper/Sofascore/Rose.php b/app/Console/Commands/Grapper/Sofascore/Rose.php index 13f28ee9..f4e1d18d 100644 --- a/app/Console/Commands/Grapper/Sofascore/Rose.php +++ b/app/Console/Commands/Grapper/Sofascore/Rose.php @@ -17,12 +17,18 @@ class Rose $debug = Grap::$options['d'] ?? 0; $restart = Grap::$options['r'] ?? 0; + + if ($debug && !$restart) { + Notice::note("RESTART ?", 'bb'); + sleep(5); + } + File::makeDirectory(Grap::$storage . '/' . Grap::$folder, 0775, true, true); if ($restart) { SofaScoreRosa::query()->update(['grapped' => 0]); if ($debug) { - Notice::note('restarted grapper', 'bb'); + Notice::note('reset all grapped to 0', 'r', 1); } } else { if ($debug) {