From 9e6f7e1c0697bbad19dc58928326fbde81d32140 Mon Sep 17 00:00:00 2001 From: salam Date: Sat, 18 Jul 2026 17:01:00 +0200 Subject: [PATCH] wip --- app/Console/Commands/Grapper/Sofascore.php | 14 ++-------- .../Grapper/Sofascore/Helper/TaskConfig.php | 28 ------------------- .../Tables/SofaScoreTasksTable.php | 21 +------------- grapper.sh | 14 +++------- 4 files changed, 8 insertions(+), 69 deletions(-) delete mode 100644 app/Console/Commands/Grapper/Sofascore/Helper/TaskConfig.php diff --git a/app/Console/Commands/Grapper/Sofascore.php b/app/Console/Commands/Grapper/Sofascore.php index 41ee7fa6..75ab5e42 100644 --- a/app/Console/Commands/Grapper/Sofascore.php +++ b/app/Console/Commands/Grapper/Sofascore.php @@ -35,28 +35,20 @@ class Sofascore break; case 3: - TaskConfig::start(); - break; - - case 4: DaysTournament::run(); break; - case 5: + case 4: self::setStorage(); Grapper::load(); break; - case 6: - TaskConfig::end(); - break; - - case 7: + case 5: self::setStorage(); ZipFolder::create(self::$storage); break; - case 8: + case 6: self::setStorage(); SendMail::run(); break; diff --git a/app/Console/Commands/Grapper/Sofascore/Helper/TaskConfig.php b/app/Console/Commands/Grapper/Sofascore/Helper/TaskConfig.php deleted file mode 100644 index 27a3f76b..00000000 --- a/app/Console/Commands/Grapper/Sofascore/Helper/TaskConfig.php +++ /dev/null @@ -1,28 +0,0 @@ -update(['last_start' => Carbon::now()]); - } - - public static function end() - { - $task_id = Nuh::$options['task'] ?? 0; - $res = SofaScoreTask::with('sport')->where('id', $task_id)->first(); - if($res->run_repeatedly){ - SofaScoreTask::query()->where('id', $task_id)->update(['compleated' => 1, 'is_active' => 1, 'last_end' => Carbon::now()]); - } - else { - SofaScoreTask::query()->where('id', $task_id)->update(['compleated' => 1, 'is_active' => 0, 'last_end' => Carbon::now()]); - } - } -} diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Tables/SofaScoreTasksTable.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Tables/SofaScoreTasksTable.php index 9b69bd90..718050be 100644 --- a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Tables/SofaScoreTasksTable.php +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Tables/SofaScoreTasksTable.php @@ -23,32 +23,13 @@ class SofaScoreTasksTable ->width(30) ->icon(fn($record) => $record->sport->icon), TextColumn::make('sport.name'), - IconColumn::make('compleated') - ->width('1rem') - ->label('Status') - ->alignCenter() - ->icon(fn(string $state): string => match ($state) { - '0' => 'phosphor-pause-fill', - '1' => 'phosphor-check-fat-fill', - }) - ->color(fn(string $state): string => match ($state) { - '0' => 'gray', - '1' => 'success', - }), TextColumn::make('mode') ->label('Grapping dates') ->formatStateUsing(fn(string $state, $record): string => match ($state) { - 'auto_updater' => 'Last 3 days', + 'auto_updater' => 'Yesterday', 'date' => $record->day_from, 'range' => $record->day_from . ' <=> ' . $record->day_to, }), - ToggleColumn::make('is_active') - ->alignCenter() - ->afterStateUpdated(function ($record) { - SofaScoreTask::where('id', $record->id)->update(['compleated' => 0]); - }), - ToggleColumn::make('run_repeatedly')->alignCenter(), - TextColumn::make('duration'), ]) ->filters([ // diff --git a/grapper.sh b/grapper.sh index c2eb0575..2d75a439 100755 --- a/grapper.sh +++ b/grapper.sh @@ -29,23 +29,17 @@ case "$1" in # echo "\n⚽ close vpn" # killall ssh - # echo "\n⚽ TaskConfig start" - php artisan nuh --d --f 67 --fun=3 --task=$1 - # echo "\n⚽ Days Tournament" - # php artisan nuh --d --f 67 --fun=4 --task=$1 + # php artisan nuh --d --f 67 --fun=3 --task=$1 # echo "\n⚽ Grapper" - # php artisan nuh --d --f 67 --fun=5 --task=$1 - - # echo "\n⚽ TaskConfig end" - # php artisan nuh --d --f 67 --fun=6 --task=$1 + # php artisan nuh --d --f 67 --fun=4 --task=$1 # echo "\n⚽ CreateZip" - # php artisan nuh --d --f 67 --fun=7 --task=$1 + # php artisan nuh --d --f 67 --fun=5 --task=$1 # echo "\n⚽ SendMail" - # php artisan nuh --d --f 67 --fun=8 --task=$1 + # php artisan nuh --d --f 67 --fun=6 --task=$1 echo "\n😎 done :)" ;;