wip
This commit is contained in:
1 parent
06c014fa1b
commit
e4ff6929e7
5 files changed
+59
-17
No files matched your search
@@ -10,6 +10,7 @@ use App\Console\Commands\Grapper\Sofascore\PlayerPerSeason;
|
|||||||
use App\Console\Commands\Grapper\Sofascore\Rose;
|
use App\Console\Commands\Grapper\Sofascore\Rose;
|
||||||
use App\Console\Commands\Grapper\Sofascore\SendMail;
|
use App\Console\Commands\Grapper\Sofascore\SendMail;
|
||||||
use App\Console\Commands\Grapper\Sofascore\SettingsToLocal;
|
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\SqlMover;
|
||||||
use App\Console\Commands\Grapper\Sofascore\TournamentTeams;
|
use App\Console\Commands\Grapper\Sofascore\TournamentTeams;
|
||||||
use App\Console\Commands\Nuh;
|
use App\Console\Commands\Nuh;
|
||||||
@@ -77,6 +78,10 @@ class Sofascore
|
|||||||
TournamentTeams::get();
|
TournamentTeams::get();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 10:
|
||||||
|
SettingsToProduction::run();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Notice::note('id not valid', 'br', 1);
|
Notice::note('id not valid', 'br', 1);
|
||||||
}
|
}
|
||||||
@@ -94,7 +99,7 @@ class Sofascore
|
|||||||
switch ($task) {
|
switch ($task) {
|
||||||
case 1:
|
case 1:
|
||||||
self::$archive_name = Carbon::now()->subDays(3)->format('Y-m-d') . '.zip';
|
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;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ use App\Console\Commands\Grapper\Sofascore\Helper\Strings;
|
|||||||
use App\Console\Commands\Nuh;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\SofaScoreRosa;
|
use App\Models\SofaScoreRosa;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
use Carbon\Carbon;
|
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
|
|
||||||
class Rose
|
class Rose
|
||||||
@@ -33,15 +32,14 @@ class Rose
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// $res = SofaScoreRosa::where('id', '>', 441)->get();
|
|
||||||
|
|
||||||
$res = SofaScoreRosa::get();
|
$res = SofaScoreRosa::get();
|
||||||
|
|
||||||
foreach ($res as $value) {
|
foreach ($res as $value) {
|
||||||
|
|
||||||
$url = Nuh::$options['base_url'] . 'api/v1/team/' . $value->ssteam_id . '/players';
|
$url = Nuh::$options['base_url'] . 'api/v1/team/' . $value->ssteam_id . '/players';
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
$data = CurlSofa::load($url);
|
||||||
|
$data['ss_team_id'] = $value->ssteam_id;
|
||||||
|
$data['ss_team_name'] = $value->ssteam_name;
|
||||||
|
|
||||||
/*********************************
|
/*********************************
|
||||||
* add team to folder
|
* add team to folder
|
||||||
@@ -51,7 +49,6 @@ class Rose
|
|||||||
|
|
||||||
SofaScoreRosa::where('id', $value->id)->update(['grapped' => 1]);
|
SofaScoreRosa::where('id', $value->id)->update(['grapped' => 1]);
|
||||||
|
|
||||||
|
|
||||||
if (rand(0, 1))
|
if (rand(0, 1))
|
||||||
Sleeper::rand(1);
|
Sleeper::rand(1);
|
||||||
else
|
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,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,9 +20,9 @@ class SofaScoreRosaResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'name';
|
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';
|
protected static string|UnitEnum|null $navigationGroup = 'SofaScore';
|
||||||
|
|
||||||
|
|||||||
+9
-9
@@ -27,11 +27,11 @@ case "$1" in
|
|||||||
echo "\n⚽ Grapper"
|
echo "\n⚽ Grapper"
|
||||||
php artisan nuh --d --f --ff 67 --fun=3 --task=1
|
php artisan nuh --d --f --ff 67 --fun=3 --task=1
|
||||||
|
|
||||||
# echo "\n⚽ CreateZip"
|
echo "\n⚽ CreateZip"
|
||||||
# php artisan nuh --d --f 67 --fun=4 --task=1
|
php artisan nuh --d --f 67 --fun=4 --task=1
|
||||||
|
|
||||||
# echo "\n⚽ SendMail"
|
echo "\n⚽ SendMail"
|
||||||
# php artisan nuh --d --f 67 --fun=5 --task=1
|
php artisan nuh --d --f 67 --fun=5 --task=1
|
||||||
|
|
||||||
echo "\n😎 task done :)"
|
echo "\n😎 task done :)"
|
||||||
echo ""
|
echo ""
|
||||||
@@ -97,7 +97,7 @@ case "$1" in
|
|||||||
echo "5 sec to stop"
|
echo "5 sec to stop"
|
||||||
echo "restart with second param: 1"
|
echo "restart with second param: 1"
|
||||||
echo "--------------------------"
|
echo "--------------------------"
|
||||||
#sleep 5
|
sleep 5
|
||||||
|
|
||||||
php artisan nuh --d --f 67 --fun=9 --restart=$2
|
php artisan nuh --d --f 67 --fun=9 --restart=$2
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ case "$1" in
|
|||||||
echo "5 sec to stop"
|
echo "5 sec to stop"
|
||||||
echo "restart with second param: 1"
|
echo "restart with second param: 1"
|
||||||
echo "--------------------------"
|
echo "--------------------------"
|
||||||
sleep 5
|
# sleep 5
|
||||||
|
|
||||||
php artisan nuh --d --f 67 --fun=6 --task=4 --restart=$2
|
php artisan nuh --d --f 67 --fun=6 --task=4 --restart=$2
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ case "$1" in
|
|||||||
echo "\n😎 task done :)"
|
echo "\n😎 task done :)"
|
||||||
echo ""
|
echo ""
|
||||||
;;
|
;;
|
||||||
"6")
|
"7")
|
||||||
echo ""
|
echo ""
|
||||||
echo "\033[1;36m";
|
echo "\033[1;36m";
|
||||||
echo "--------------------------"
|
echo "--------------------------"
|
||||||
@@ -161,7 +161,7 @@ case "$1" in
|
|||||||
echo "\n--------------------------"
|
echo "\n--------------------------"
|
||||||
echo "5 sec to stop"
|
echo "5 sec to stop"
|
||||||
echo "--------------------------"
|
echo "--------------------------"
|
||||||
sleep 5
|
# sleep 5
|
||||||
|
|
||||||
echo "\n⚽ close all vpn"
|
echo "\n⚽ close all vpn"
|
||||||
killall ssh
|
killall ssh
|
||||||
@@ -169,7 +169,7 @@ case "$1" in
|
|||||||
echo "\n⚽ open vpn"
|
echo "\n⚽ open vpn"
|
||||||
ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190
|
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"
|
echo "\n⚽ close vpn"
|
||||||
killall ssh
|
killall ssh
|
||||||
|
|||||||
Reference in new issue
Block a user