diff --git a/app/Console/Commands/Grapper/Sofascore.php b/app/Console/Commands/Grapper/Sofascore.php index 2c1e2661..cafc8668 100644 --- a/app/Console/Commands/Grapper/Sofascore.php +++ b/app/Console/Commands/Grapper/Sofascore.php @@ -10,6 +10,7 @@ use App\Console\Commands\Grapper\Sofascore\PlayerPerSeason; use App\Console\Commands\Grapper\Sofascore\Rose; use App\Console\Commands\Grapper\Sofascore\SendMail; use App\Console\Commands\Grapper\Sofascore\SettingsToLocal; +use App\Console\Commands\Grapper\Sofascore\SettingsToProduction; use App\Console\Commands\Grapper\Sofascore\SqlMover; use App\Console\Commands\Grapper\Sofascore\TournamentTeams; use App\Console\Commands\Nuh; @@ -77,6 +78,10 @@ class Sofascore TournamentTeams::get(); break; + case 10: + SettingsToProduction::run(); + break; + default: Notice::note('id not valid', 'br', 1); } @@ -94,7 +99,7 @@ class Sofascore switch ($task) { case 1: self::$archive_name = Carbon::now()->subDays(3)->format('Y-m-d') . '.zip'; - self::$storage .= $storage_name; + self::$storage .= $storage_name . Carbon::now()->subDays(3)->format('Y-m-d'); break; case 2: case 3: diff --git a/app/Console/Commands/Grapper/Sofascore/Rose.php b/app/Console/Commands/Grapper/Sofascore/Rose.php index b9ef27c5..c85eb523 100644 --- a/app/Console/Commands/Grapper/Sofascore/Rose.php +++ b/app/Console/Commands/Grapper/Sofascore/Rose.php @@ -9,7 +9,6 @@ use App\Console\Commands\Grapper\Sofascore\Helper\Strings; use App\Console\Commands\Nuh; use App\Models\SofaScoreRosa; use App\Utilities\Notice; -use Carbon\Carbon; use Illuminate\Support\Facades\File; class Rose @@ -33,15 +32,14 @@ class Rose } } - // $res = SofaScoreRosa::where('id', '>', 441)->get(); - $res = SofaScoreRosa::get(); foreach ($res as $value) { - $url = Nuh::$options['base_url'] . 'api/v1/team/' . $value->ssteam_id . '/players'; $data = CurlSofa::load($url); + $data['ss_team_id'] = $value->ssteam_id; + $data['ss_team_name'] = $value->ssteam_name; /********************************* * add team to folder @@ -51,7 +49,6 @@ class Rose SofaScoreRosa::where('id', $value->id)->update(['grapped' => 1]); - if (rand(0, 1)) Sleeper::rand(1); else diff --git a/app/Console/Commands/Grapper/Sofascore/SettingsToProduction.php b/app/Console/Commands/Grapper/Sofascore/SettingsToProduction.php new file mode 100644 index 00000000..0aedcc9c --- /dev/null +++ b/app/Console/Commands/Grapper/Sofascore/SettingsToProduction.php @@ -0,0 +1,40 @@ +table('sofa_score_rosa_tournaments')->truncate(); + + $rows = SofaScoreRosaTournament::get(); + + foreach ($rows as $row) { + + DB::connection('remote_mariadb')->table('sofa_score_rosa_tournaments')->insert([ + "ssteam_id" => $row->ssteam_id, + "ss_tournament_id" => $row->ss_tournament_id, + "disabled" => $row->disabled, + "grapped" => $row->grapped, + "created_at" => $row->created_at, + "updated_at" => $row->updated_at, + ]); + } + } +} diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreRosas/SofaScoreRosaResource.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreRosas/SofaScoreRosaResource.php index 087e90aa..3bd74a1b 100644 --- a/app/Filament/Clusters/StaticData/Resources/SofaScoreRosas/SofaScoreRosaResource.php +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreRosas/SofaScoreRosaResource.php @@ -20,9 +20,9 @@ class SofaScoreRosaResource extends Resource protected static ?string $recordTitleAttribute = 'name'; - protected static ?string $navigationLabel = 'Rooster'; + protected static ?string $navigationLabel = 'Rosters'; - protected static ?string $modelLabel = 'Rooster'; + protected static ?string $modelLabel = 'Rosters'; protected static string|UnitEnum|null $navigationGroup = 'SofaScore'; diff --git a/grapper.sh b/grapper.sh index 9c4be187..44cff7b0 100755 --- a/grapper.sh +++ b/grapper.sh @@ -27,11 +27,11 @@ case "$1" in echo "\n⚽ Grapper" php artisan nuh --d --f --ff 67 --fun=3 --task=1 - # echo "\n⚽ CreateZip" - # php artisan nuh --d --f 67 --fun=4 --task=1 + echo "\n⚽ CreateZip" + php artisan nuh --d --f 67 --fun=4 --task=1 - # echo "\n⚽ SendMail" - # php artisan nuh --d --f 67 --fun=5 --task=1 + echo "\n⚽ SendMail" + php artisan nuh --d --f 67 --fun=5 --task=1 echo "\n😎 task done :)" echo "" @@ -97,7 +97,7 @@ case "$1" in echo "5 sec to stop" echo "restart with second param: 1" echo "--------------------------" - #sleep 5 + sleep 5 php artisan nuh --d --f 67 --fun=9 --restart=$2 @@ -116,7 +116,7 @@ case "$1" in echo "5 sec to stop" echo "restart with second param: 1" echo "--------------------------" - sleep 5 + # sleep 5 php artisan nuh --d --f 67 --fun=6 --task=4 --restart=$2 @@ -150,7 +150,7 @@ case "$1" in echo "\n😎 task done :)" echo "" ;; -"6") +"7") echo "" echo "\033[1;36m"; echo "--------------------------" @@ -161,7 +161,7 @@ case "$1" in echo "\n--------------------------" echo "5 sec to stop" echo "--------------------------" - sleep 5 + # sleep 5 echo "\n⚽ close all vpn" killall ssh @@ -169,7 +169,7 @@ case "$1" in echo "\n⚽ open vpn" ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190 - # php artisan nuh --d --f 67 --fun=2 --task=0 + php artisan nuh --d --f 67 --fun=10 --task=0 echo "\n⚽ close vpn" killall ssh