This commit is contained in:
salam committed 2026-07-30 09:17:34 +02:00
1 parent 06c014fa1b
commit e4ff6929e7
5 files changed
+59 -17

No files matched your search

+6 -1
View File
@@ -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:
@@ -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
@@ -0,0 +1,40 @@
<?php
namespace App\Console\Commands\Grapper\Sofascore;
use App\Console\Commands\Nuh;
use App\Models\SofaScoreRosaTournament;
use App\Utilities\Notice;
use Illuminate\Support\Facades\DB;
class SettingsToProduction
{
public static function run()
{
$debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note('Settings To Production', 'bb');
}
if ($debug) {
Notice::note('SofaScoreRosaTournament', 'g');
}
DB::connection('remote_mariadb')->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,
]);
}
}
}