ss ->sortable
This commit is contained in:
1 parent
c8cf1edaf4
commit
000f6fa046
18 files changed
+157
-106
No files matched your search
@@ -10,6 +10,7 @@ use App\Console\Commands\Grapper\Sofascore\SendMail;
|
|||||||
use App\Console\Commands\Grapper\Sofascore\SettingsToLocal;
|
use App\Console\Commands\Grapper\Sofascore\SettingsToLocal;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use App\Console\Commands\Grapper\Sofascore\Rose;
|
||||||
|
|
||||||
class Grap extends Command
|
class Grap extends Command
|
||||||
{
|
{
|
||||||
@@ -40,16 +41,13 @@ class Grap extends Command
|
|||||||
$txt .= '--folder' . PHP_EOL;
|
$txt .= '--folder' . PHP_EOL;
|
||||||
$txt .= '-----------------------------------------------------------' . PHP_EOL;
|
$txt .= '-----------------------------------------------------------' . PHP_EOL;
|
||||||
$txt .= 'FUNCTION' . PHP_EOL;
|
$txt .= 'FUNCTION' . PHP_EOL;
|
||||||
$txt .= ' 1 grapper daily & subDays ( default 3)' . PHP_EOL;
|
$txt .= ' 1 grapper DAILY & subDays ( default 3)' . PHP_EOL;
|
||||||
$txt .= ' 2 grapper date' . PHP_EOL;
|
$txt .= ' 2 grapper DATE' . PHP_EOL;
|
||||||
$txt .= ' 3 grapper range' . PHP_EOL;
|
$txt .= ' 3 grapper RANGE' . PHP_EOL;
|
||||||
$txt .= ' 4 grapper rose' . PHP_EOL;
|
$txt .= ' 4 grapper ROSE' . PHP_EOL;
|
||||||
$txt .= ' 5 make ecxel from folder' . PHP_EOL;
|
$txt .= ' 5 import to excel from folder' . PHP_EOL;
|
||||||
$txt .= ' 5 playeer/season' . PHP_EOL;
|
$txt .= ' 6 playeer/season' . PHP_EOL;
|
||||||
// $txt .= " 1\tPlayerPerSeason".PHP_EOL;
|
$txt .= ' 7 settings to local' . PHP_EOL;
|
||||||
// $txt .= " 1\tPlayerPerSeason".PHP_EOL;
|
|
||||||
// $txt .= " 1\tPlayerPerSeason".PHP_EOL;
|
|
||||||
// $txt .= " 2\tSettingsToLocal".PHP_EOL;
|
|
||||||
Notice::note($txt, 'b', 1);
|
Notice::note($txt, 'b', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,8 +57,6 @@ class Grap extends Command
|
|||||||
switch (self::$options['id']) {
|
switch (self::$options['id']) {
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
SettingsToLocal::run();
|
|
||||||
|
|
||||||
SetStorage::set(1);
|
SetStorage::set(1);
|
||||||
|
|
||||||
Grapper::load(1);
|
Grapper::load(1);
|
||||||
@@ -69,14 +65,6 @@ class Grap extends Command
|
|||||||
|
|
||||||
SendMail::run(1);
|
SendMail::run(1);
|
||||||
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
SetStorage::set(5);
|
|
||||||
|
|
||||||
MakeExcel::create();
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
PlayerPerSeason::run();
|
|
||||||
break;
|
break;
|
||||||
// case 2:
|
// case 2:
|
||||||
// SetStorage::set();
|
// SetStorage::set();
|
||||||
@@ -88,11 +76,30 @@ class Grap extends Command
|
|||||||
|
|
||||||
// Grapper::load(3);
|
// Grapper::load(3);
|
||||||
// break;
|
// break;
|
||||||
// case 4:
|
case 4:
|
||||||
// SetStorage::set();
|
SetStorage::set(4);
|
||||||
|
|
||||||
|
Rose::run();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
SetStorage::set(5);
|
||||||
|
|
||||||
|
MakeExcel::create();
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
PlayerPerSeason::run();
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
|
||||||
|
SettingsToLocal::run();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 8:
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
// Grapper::load(4);
|
|
||||||
// break;
|
|
||||||
// case 5:
|
// case 5:
|
||||||
|
|
||||||
// PlayerPerSeason::run();
|
// PlayerPerSeason::run();
|
||||||
|
|||||||
@@ -58,11 +58,7 @@ class Grapper
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('reset grapper', 'br', 1);
|
Notice::note('Restarted grapper', 'br', 1);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('continuing grapper', 'bg');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,10 +68,6 @@ class Grapper
|
|||||||
|
|
||||||
foreach ($active_tournaments as $tournament) {
|
foreach ($active_tournaments as $tournament) {
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('START '.$tournament->tournament->name, 'p');
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = SofaScoreDayTournament::whereDate('day', '=', $day)->where('tournament_id', $tournament->sofa_score_tournament_id)->first();
|
$res = SofaScoreDayTournament::whereDate('day', '=', $day)->where('tournament_id', $tournament->sofa_score_tournament_id)->first();
|
||||||
|
|
||||||
if ($res) {
|
if ($res) {
|
||||||
@@ -84,7 +76,7 @@ class Grapper
|
|||||||
Notice::note($day, 'g');
|
Notice::note($day, 'g');
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = Grap::$options['base_url']."api/v1/unique-tournament/$tournament->sofa_score_tournament_id/scheduled-events/$day";
|
$url = Grap::$options['base_url'] . "api/v1/unique-tournament/$tournament->sofa_score_tournament_id/scheduled-events/$day";
|
||||||
|
|
||||||
Sleeper::rand(1);
|
Sleeper::rand(1);
|
||||||
|
|
||||||
@@ -92,13 +84,19 @@ class Grapper
|
|||||||
|
|
||||||
if (isset($data['events'])) {
|
if (isset($data['events'])) {
|
||||||
|
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note($tournament->tournament->name, 'bb');
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($data['events'] as $event) {
|
foreach ($data['events'] as $event) {
|
||||||
|
|
||||||
|
dd($event);
|
||||||
|
|
||||||
Grap::$useragent = rand(1, 6);
|
Grap::$useragent = rand(1, 6);
|
||||||
|
|
||||||
if (! $force && SofaScoreEventGrapped::where('id', (int) $event['id'])->exists()) {
|
if (! $force && SofaScoreEventGrapped::where('id', (int) $event['id'])->exists()) {
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('Grapped '.$day.' - '.$event['homeTeam']['name'].' vs '.$event['awayTeam']['name'], 'g');
|
Notice::note('Grapped ' . $day . ' - ' . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'g');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -113,18 +111,18 @@ class Grapper
|
|||||||
Sleeper::rand(1);
|
Sleeper::rand(1);
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note($day.' - '.$event['homeTeam']['name'].' vs '.$event['awayTeam']['name'], 'bg');
|
Notice::note($day . ' - ' . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'bg');
|
||||||
}
|
}
|
||||||
|
|
||||||
$grapped = SofaScoreEventGrapped::firstOrNew(['id' => $event['id']]);
|
$grapped = SofaScoreEventGrapped::firstOrNew(['id' => $event['id']]);
|
||||||
$grapped->grapper_id = $task_id;
|
$grapped->grapper_id = $task_id;
|
||||||
$grapped->day = $day;
|
$grapped->day = $day;
|
||||||
$grapped->liga = $event['tournament']['name'];
|
$grapped->liga = $event['tournament']['name'];
|
||||||
$grapped->name = $event['homeTeam']['name'].' vs '.$event['awayTeam']['name'];
|
$grapped->name = $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'];
|
||||||
$grapped->url = $url;
|
$grapped->url = $url;
|
||||||
$grapped->starttime = $starttime->toDateTimeString();
|
$grapped->starttime = $starttime->toDateTimeString();
|
||||||
|
|
||||||
$folder = Grap::$storage.'/'.$day.'/'.$day.'-'.$event['tournament']['slug'].'/'.$event['slug'];
|
$folder = Grap::$storage . '/' . $day . '/' . $day . '-' . $event['tournament']['category']['slug'] . '-' . $event['tournament']['slug'] . '/' . $event['slug'];
|
||||||
|
|
||||||
File::makeDirectory($folder, 0775, true, true);
|
File::makeDirectory($folder, 0775, true, true);
|
||||||
|
|
||||||
@@ -132,7 +130,7 @@ class Grapper
|
|||||||
* EVENT event
|
* EVENT event
|
||||||
*********************************/
|
*********************************/
|
||||||
|
|
||||||
File::put($folder.'/event.json', json_encode($event));
|
File::put($folder . '/event.json', json_encode($event));
|
||||||
|
|
||||||
/*********************************
|
/*********************************
|
||||||
* EVENT statistics
|
* EVENT statistics
|
||||||
@@ -140,7 +138,7 @@ class Grapper
|
|||||||
|
|
||||||
$event_id = $event['id'];
|
$event_id = $event['id'];
|
||||||
|
|
||||||
$url = Grap::$options['base_url']."api/v1/event/$event_id/statistics";
|
$url = Grap::$options['base_url'] . "api/v1/event/$event_id/statistics";
|
||||||
|
|
||||||
Sleeper::rand();
|
Sleeper::rand();
|
||||||
|
|
||||||
@@ -148,7 +146,7 @@ class Grapper
|
|||||||
|
|
||||||
$data['id'] = $event_id;
|
$data['id'] = $event_id;
|
||||||
|
|
||||||
File::put($folder.'/statistics.json', json_encode($data));
|
File::put($folder . '/statistics.json', json_encode($data));
|
||||||
|
|
||||||
$grapped->got_statistics = 1;
|
$grapped->got_statistics = 1;
|
||||||
|
|
||||||
@@ -156,7 +154,7 @@ class Grapper
|
|||||||
* EVENT lineups
|
* EVENT lineups
|
||||||
*********************************/
|
*********************************/
|
||||||
|
|
||||||
$url = Grap::$options['base_url']."api/v1/event/$event_id/lineups";
|
$url = Grap::$options['base_url'] . "api/v1/event/$event_id/lineups";
|
||||||
|
|
||||||
Sleeper::rand();
|
Sleeper::rand();
|
||||||
|
|
||||||
@@ -164,7 +162,7 @@ class Grapper
|
|||||||
|
|
||||||
$data['id'] = $event_id;
|
$data['id'] = $event_id;
|
||||||
|
|
||||||
File::put($folder.'/lineups.json', json_encode($data));
|
File::put($folder . '/lineups.json', json_encode($data));
|
||||||
|
|
||||||
$grapped->got_lineups = 1;
|
$grapped->got_lineups = 1;
|
||||||
|
|
||||||
@@ -172,7 +170,7 @@ class Grapper
|
|||||||
* EVENT odds
|
* EVENT odds
|
||||||
*********************************/
|
*********************************/
|
||||||
|
|
||||||
$url = Grap::$options['base_url']."api/v1/event/$event_id/odds/1/all";
|
$url = Grap::$options['base_url'] . "api/v1/event/$event_id/odds/1/all";
|
||||||
|
|
||||||
Sleeper::rand();
|
Sleeper::rand();
|
||||||
|
|
||||||
@@ -180,7 +178,7 @@ class Grapper
|
|||||||
|
|
||||||
$data['id'] = $event_id;
|
$data['id'] = $event_id;
|
||||||
|
|
||||||
File::put($folder.'/odds.json', json_encode($data));
|
File::put($folder . '/odds.json', json_encode($data));
|
||||||
|
|
||||||
$grapped->got_odds = 1;
|
$grapped->got_odds = 1;
|
||||||
|
|
||||||
@@ -188,7 +186,7 @@ class Grapper
|
|||||||
* EVENT incidents
|
* EVENT incidents
|
||||||
*********************************/
|
*********************************/
|
||||||
|
|
||||||
$url = Grap::$options['base_url']."api/v1/event/$event_id/incidents";
|
$url = Grap::$options['base_url'] . "api/v1/event/$event_id/incidents";
|
||||||
|
|
||||||
Sleeper::rand();
|
Sleeper::rand();
|
||||||
|
|
||||||
@@ -196,7 +194,7 @@ class Grapper
|
|||||||
|
|
||||||
$data['id'] = $event_id;
|
$data['id'] = $event_id;
|
||||||
|
|
||||||
File::put($folder.'/incidents.json', json_encode($data));
|
File::put($folder . '/incidents.json', json_encode($data));
|
||||||
|
|
||||||
$grapped->got_incidents = 1;
|
$grapped->got_incidents = 1;
|
||||||
|
|
||||||
@@ -206,9 +204,6 @@ class Grapper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($debug) {
|
|
||||||
Notice::note('END '.$tournament->tournament->name, 'p');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SofaScoreTaskDay::updateOrCreate([
|
SofaScoreTaskDay::updateOrCreate([
|
||||||
'grapper_id' => (int) $task_id,
|
'grapper_id' => (int) $task_id,
|
||||||
@@ -220,9 +215,8 @@ class Grapper
|
|||||||
$count++;
|
$count++;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note($count.' days done', 'bb');
|
Notice::note("Grapper done, ($count)", 'bb');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ class SetStorage
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
Grap::$storage = $sofascore_data . $storage_name . '/rosa-' . Carbon::now()->format('Y-m-d');
|
Grap::$storage = $sofascore_data . $storage_name . '/rosa-' . Carbon::now()->format('Y-m-d');
|
||||||
Grap::$zipfile = $sofascore_data . $storage_name . '/rosa-' . Carbon::now()->format('Y-m-d') . '.zip';
|
Grap::$folder = $storage_name;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
Grap::$storage = $sofascore_data;
|
Grap::$storage = $sofascore_data;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class Sleeper
|
|||||||
public static function rand($langsam = false)
|
public static function rand($langsam = false)
|
||||||
{
|
{
|
||||||
if ($langsam) {
|
if ($langsam) {
|
||||||
$sleep = rand(3000000, 6000000);
|
$sleep = rand(3000000, 7000000);
|
||||||
} else {
|
} else {
|
||||||
$sleep = rand(100000, 150000);
|
$sleep = rand(100000, 150000);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ namespace App\Console\Commands\Grapper\Sofascore;
|
|||||||
use App\Console\Commands\Grap;
|
use App\Console\Commands\Grap;
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\FileType;
|
use App\Console\Commands\Grapper\Sofascore\Helper\FileType;
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\ReadDir;
|
use App\Console\Commands\Grapper\Sofascore\Helper\ReadDir;
|
||||||
use App\Console\Commands\Nuh;
|
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||||
@@ -20,10 +19,10 @@ class MakeExcel
|
|||||||
{
|
{
|
||||||
ini_set('memory_limit', -1);
|
ini_set('memory_limit', -1);
|
||||||
|
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
$debug = Grap::$options['d'] ?? 0;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('Make Excel folder to import: ' . Grap::$folder . "\nmaximum files in excel: " . self::$max, 'b');
|
Notice::note("Make Excel\nFolder: " . Grap::$folder . "\nMax/file: " . self::$max, 'bb');
|
||||||
}
|
}
|
||||||
|
|
||||||
$files = ReadDir::get_tree(Grap::$storage . '/' . Grap::$folder);
|
$files = ReadDir::get_tree(Grap::$storage . '/' . Grap::$folder);
|
||||||
|
|||||||
@@ -2,11 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
namespace App\Console\Commands\Grapper\Sofascore;
|
||||||
|
|
||||||
use App\Console\Commands\Grapper\Sofascore;
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\CurlSofa;
|
use App\Console\Commands\Grapper\Sofascore\Helper\CurlSofa;
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\Sleeper;
|
use App\Console\Commands\Grapper\Sofascore\Helper\Sleeper;
|
||||||
use App\Console\Commands\Grapper\Sofascore\Helper\Strings;
|
use App\Console\Commands\Grapper\Sofascore\Helper\Strings;
|
||||||
use App\Console\Commands\Nuh;
|
use App\Console\Commands\Grap;
|
||||||
use App\Models\SofaScoreRosa;
|
use App\Models\SofaScoreRosa;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
@@ -15,11 +14,10 @@ class Rose
|
|||||||
{
|
{
|
||||||
public static function run()
|
public static function run()
|
||||||
{
|
{
|
||||||
File::makeDirectory(Sofascore::$storage, 0775, true, true);
|
$debug = Grap::$options['d'] ?? 0;
|
||||||
|
$restart = Grap::$options['r'] ?? 0;
|
||||||
|
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
File::makeDirectory(Grap::$storage, 0775, true, true);
|
||||||
|
|
||||||
$restart = Nuh::$options['restart'] ?? 0;
|
|
||||||
|
|
||||||
if ($restart) {
|
if ($restart) {
|
||||||
SofaScoreRosa::query()->update(['grapped' => 0]);
|
SofaScoreRosa::query()->update(['grapped' => 0]);
|
||||||
@@ -35,9 +33,10 @@ class Rose
|
|||||||
$res = SofaScoreRosa::get();
|
$res = SofaScoreRosa::get();
|
||||||
|
|
||||||
foreach ($res as $value) {
|
foreach ($res as $value) {
|
||||||
$url = Nuh::$options['base_url'] . 'api/v1/team/' . $value->ss_team_id . '/players';
|
$url = Grap::$options['base_url'] . 'api/v1/team/' . $value->ss_team_id . '/players';
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
$data['ss_team_id'] = $value->ss_team_id;
|
$data['ss_team_id'] = $value->ss_team_id;
|
||||||
$data['ss_team_name'] = $value->ss_team_name;
|
$data['ss_team_name'] = $value->ss_team_name;
|
||||||
|
|
||||||
@@ -45,7 +44,7 @@ class Rose
|
|||||||
* add team to folder
|
* add team to folder
|
||||||
*********************************/
|
*********************************/
|
||||||
|
|
||||||
File::put(Sofascore::$storage . '/' . Strings::clean($value->ss_team_name) . '.json', json_encode($data));
|
File::put(Grap::$storage . '/' . Strings::clean($value->ss_team_name) . '.json', json_encode($data));
|
||||||
|
|
||||||
SofaScoreRosa::where('id', $value->id)->update(['grapped' => 1]);
|
SofaScoreRosa::where('id', $value->id)->update(['grapped' => 1]);
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ class SendMail
|
|||||||
{
|
{
|
||||||
$debug = Grap::$options['d'] ?? 0;
|
$debug = Grap::$options['d'] ?? 0;
|
||||||
|
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note('Send Mail', 'bb');
|
||||||
|
}
|
||||||
|
|
||||||
$task = SofaScoreTask::where('id', $task_id)->first();
|
$task = SofaScoreTask::where('id', $task_id)->first();
|
||||||
|
|
||||||
$files = ReadDir::get_tree(Grap::$storage);
|
$files = ReadDir::get_tree(Grap::$storage);
|
||||||
@@ -34,11 +38,7 @@ class SendMail
|
|||||||
new SofaScoreDataMail($header, $table, $sendfiles)
|
new SofaScoreDataMail($header, $table, $sendfiles)
|
||||||
);
|
);
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('Mail: '.$header);
|
Notice::note("Mail Send", 'bg');
|
||||||
}
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note('mail send', 'g');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ class SendMail
|
|||||||
|
|
||||||
$table = '';
|
$table = '';
|
||||||
foreach ($res as $value) {
|
foreach ($res as $value) {
|
||||||
$table .= '|'.$value->liga.'|'.$value->name.'|'.$value->starttime.'|
|
$table .= '|' . $value->liga . '|' . $value->name . '|' . $value->starttime . '|
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,13 +60,13 @@ class SendMail
|
|||||||
$text = '## ';
|
$text = '## ';
|
||||||
switch ($task->mode) {
|
switch ($task->mode) {
|
||||||
case 'daily':
|
case 'daily':
|
||||||
$text = $task->name.' - '.Carbon::now()->subDays(3)->format('Y-m-d');
|
$text = $task->name . ' - ' . Carbon::now()->subDays(3)->format('Y-m-d');
|
||||||
break;
|
break;
|
||||||
case 'date':
|
case 'date':
|
||||||
$text = $task->name.' - '.$task->day_from;
|
$text = $task->name . ' - ' . $task->day_from;
|
||||||
break;
|
break;
|
||||||
case 'range':
|
case 'range':
|
||||||
$text = $task->name.' - '.$task->day_from.' - '.$task->day_to;
|
$text = $task->name . ' - ' . $task->day_from . ' - ' . $task->day_to;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -15,13 +15,17 @@ class SettingsToLocal
|
|||||||
{
|
{
|
||||||
$debug = Grap::$options['d'] ?? 0;
|
$debug = Grap::$options['d'] ?? 0;
|
||||||
|
|
||||||
Notice::note("⚽ close all vpn");
|
if ($debug) {
|
||||||
|
Notice::note("⚽ settings to local");
|
||||||
|
Notice::note("⚽ close all vpn");
|
||||||
|
}
|
||||||
exec('killall ssh');
|
exec('killall ssh');
|
||||||
|
|
||||||
Notice::note("⚽ open vpn");
|
if ($debug) {
|
||||||
|
Notice::note("⚽ open vpn");
|
||||||
|
}
|
||||||
exec('ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190');
|
exec('ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190');
|
||||||
|
|
||||||
Notice::note("⚽ settings to local");
|
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('SofaScoreTask', 'g');
|
Notice::note('SofaScoreTask', 'g');
|
||||||
@@ -50,7 +54,9 @@ class SettingsToLocal
|
|||||||
SofaScoreTournament::insert((array) $row);
|
SofaScoreTournament::insert((array) $row);
|
||||||
}
|
}
|
||||||
|
|
||||||
Notice::note("⚽ close all vpn");
|
if ($debug) {
|
||||||
|
Notice::note("⚽ close all vpn");
|
||||||
|
}
|
||||||
exec('killall ssh');
|
exec('killall ssh');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+10
-6
@@ -36,19 +36,23 @@ class CompetitionGroupsTable
|
|||||||
->grow(false)
|
->grow(false)
|
||||||
->color('primary')
|
->color('primary')
|
||||||
->width(30)
|
->width(30)
|
||||||
->icon(fn ($record) => $record->sport->icon)
|
->icon(fn($record) => $record->sport->icon)
|
||||||
->tooltip(fn ($record) => $record->id)
|
->tooltip(fn($record) => $record->id)
|
||||||
->visibleFrom('lg'),
|
->visibleFrom('lg'),
|
||||||
TextColumn::make('id')->copyable()->alignCenter()->tooltip('Click to copy'),
|
TextColumn::make('id')->copyable()->alignCenter()->tooltip('Click to copy')
|
||||||
|
->sortable(),
|
||||||
TextColumn::make('name')
|
TextColumn::make('name')
|
||||||
|
->sortable()
|
||||||
->color('primary')
|
->color('primary')
|
||||||
->searchable(),
|
->searchable(),
|
||||||
TextColumn::make('country.name')
|
TextColumn::make('country.name')
|
||||||
->wrap()
|
->wrap()
|
||||||
|
->sortable()
|
||||||
->color('gray')
|
->color('gray')
|
||||||
->label('Country')
|
->label('Country')
|
||||||
->icon(fn ($record) => $record->country->icon),
|
->icon(fn($record) => $record->country->icon),
|
||||||
SelectColumn::make('level')
|
SelectColumn::make('level')
|
||||||
|
->sortable()
|
||||||
->width(30)
|
->width(30)
|
||||||
->options([
|
->options([
|
||||||
'TOP' => 'TOP',
|
'TOP' => 'TOP',
|
||||||
@@ -60,11 +64,11 @@ class CompetitionGroupsTable
|
|||||||
->label('Sport')
|
->label('Sport')
|
||||||
->default(1)
|
->default(1)
|
||||||
->selectablePlaceholder(false)
|
->selectablePlaceholder(false)
|
||||||
->options(fn () => Sport::where('is_active', 1)->pluck('name', 'id')->toArray()),
|
->options(fn() => Sport::where('is_active', 1)->pluck('name', 'id')->toArray()),
|
||||||
SelectFilter::make('country_id')
|
SelectFilter::make('country_id')
|
||||||
->searchable()
|
->searchable()
|
||||||
->label('Countries')
|
->label('Countries')
|
||||||
->options(fn () => Country::orderBy('name')->pluck('name', 'id')->toArray()),
|
->options(fn() => Country::orderBy('name')->pluck('name', 'id')->toArray()),
|
||||||
], layout: FiltersLayout::AboveContent)
|
], layout: FiltersLayout::AboveContent)
|
||||||
->deferFilters(false)
|
->deferFilters(false)
|
||||||
->recordActions([
|
->recordActions([
|
||||||
|
|||||||
@@ -64,12 +64,15 @@ class CountryResource extends Resource
|
|||||||
->recordTitleAttribute('name')
|
->recordTitleAttribute('name')
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('id')->searchable()
|
TextColumn::make('id')->searchable()
|
||||||
|
->sortable()
|
||||||
->alignCenter()->tooltip('Click to copy'),
|
->alignCenter()->tooltip('Click to copy'),
|
||||||
TextColumn::make('name')
|
TextColumn::make('name')
|
||||||
->searchable()
|
->searchable()
|
||||||
|
->sortable()
|
||||||
->color('primary')
|
->color('primary')
|
||||||
->copyable(),
|
->copyable(),
|
||||||
TextColumn::make('season_mode')
|
TextColumn::make('season_mode')
|
||||||
|
->sortable()
|
||||||
->badge()
|
->badge()
|
||||||
->formatStateUsing(fn(string $state): string => strtoupper($state))
|
->formatStateUsing(fn(string $state): string => strtoupper($state))
|
||||||
->color(fn(string $state): string => match ($state) {
|
->color(fn(string $state): string => match ($state) {
|
||||||
@@ -81,10 +84,14 @@ class CountryResource extends Resource
|
|||||||
->icon(function ($state): string {
|
->icon(function ($state): string {
|
||||||
return $state;
|
return $state;
|
||||||
})->label('Flags')->size(IconSize::TwoExtraLarge),
|
})->label('Flags')->size(IconSize::TwoExtraLarge),
|
||||||
TextColumn::make('iso3'),
|
TextColumn::make('iso3')
|
||||||
TextColumn::make('cc'),
|
->sortable(),
|
||||||
TextColumn::make('numeric'),
|
TextColumn::make('cc')
|
||||||
IconColumn::make('is_country')->alignCenter()->boolean(),
|
->sortable(),
|
||||||
|
TextColumn::make('numeric')
|
||||||
|
->sortable(),
|
||||||
|
IconColumn::make('is_country')->alignCenter()->boolean()
|
||||||
|
->sortable(),
|
||||||
|
|
||||||
])
|
])
|
||||||
->defaultSort('name', direction: 'asc')
|
->defaultSort('name', direction: 'asc')
|
||||||
|
|||||||
@@ -36,32 +36,39 @@ class ElementsTable
|
|||||||
->striped()
|
->striped()
|
||||||
->columns([
|
->columns([
|
||||||
IconColumn::make('sport.icon')
|
IconColumn::make('sport.icon')
|
||||||
|
->sortable()
|
||||||
->label('')
|
->label('')
|
||||||
->grow(false)
|
->grow(false)
|
||||||
->width(30)
|
->width(30)
|
||||||
->icon(fn ($record) => $record->sport->icon)
|
->icon(fn($record) => $record->sport->icon)
|
||||||
->tooltip(fn ($record) => $record->id)
|
->tooltip(fn($record) => $record->id)
|
||||||
->visibleFrom('lg'),
|
->visibleFrom('lg'),
|
||||||
TextColumn::make('id')
|
TextColumn::make('id')
|
||||||
|
->sortable()
|
||||||
->tooltip('click to copy')
|
->tooltip('click to copy')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->copyable(),
|
->copyable(),
|
||||||
TextColumn::make('name')
|
TextColumn::make('name')
|
||||||
|
->sortable()
|
||||||
|
->sortable()
|
||||||
->searchable()
|
->searchable()
|
||||||
->color('primary'),
|
->color('primary'),
|
||||||
TextColumn::make('country.name')
|
TextColumn::make('country.name')
|
||||||
->wrap()
|
->wrap()
|
||||||
|
->sortable()
|
||||||
->color('gray')
|
->color('gray')
|
||||||
->icon(fn ($record) => $record->country->icon),
|
->icon(fn($record) => $record->country->icon),
|
||||||
TextColumn::make('element_group.competition_group_id')->label('Group Id')
|
TextColumn::make('element_group.competition_group_id')->label('Group Id')
|
||||||
|
->sortable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->tooltip('click to copy')
|
->tooltip('click to copy')
|
||||||
->copyable(),
|
->copyable(),
|
||||||
TextColumn::make('element_group.competition_group.name')->label('Group'),
|
TextColumn::make('element_group.competition_group.name')->label('Group')
|
||||||
|
->sortable(),
|
||||||
// TextColumn::make('element_group.group.name')->label('Group'),
|
// TextColumn::make('element_group.group.name')->label('Group'),
|
||||||
ImageColumn::make('betsapi_image_id')
|
ImageColumn::make('betsapi_image_id')
|
||||||
->label('Logo')
|
->label('Logo')
|
||||||
->defaultImageUrl(fn ($state) => url('https://assets.b365api.com/images/team/m/'.$state.'.png')),
|
->defaultImageUrl(fn($state) => url('https://assets.b365api.com/images/team/m/' . $state . '.png')),
|
||||||
])->filters([
|
])->filters([
|
||||||
SelectFilter::make('sport_id')
|
SelectFilter::make('sport_id')
|
||||||
->label('Sport')
|
->label('Sport')
|
||||||
@@ -88,7 +95,7 @@ class ElementsTable
|
|||||||
->query(function (Builder $query, array $data): Builder {
|
->query(function (Builder $query, array $data): Builder {
|
||||||
return $query->when(
|
return $query->when(
|
||||||
$data['country_id'],
|
$data['country_id'],
|
||||||
fn (Builder $query, $country_id) => $query->where('country_id', $country_id)
|
fn(Builder $query, $country_id) => $query->where('country_id', $country_id)
|
||||||
)->when(
|
)->when(
|
||||||
$data['competition_group_id'],
|
$data['competition_group_id'],
|
||||||
function (Builder $query, $competition_group_id) {
|
function (Builder $query, $competition_group_id) {
|
||||||
|
|||||||
+10
-4
@@ -20,11 +20,17 @@ class SofaScoreRosasTable
|
|||||||
return $table
|
return $table
|
||||||
->defaultPaginationPageOption(50)
|
->defaultPaginationPageOption(50)
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('ss_team_id')->label('SSId')->badge()->width('1rem'),
|
TextColumn::make('ss_team_id')->label('SSId')->badge()->width('1rem')
|
||||||
TextColumn::make('country.name')->label('Country'),
|
->sortable(),
|
||||||
TextColumn::make('tournament_rosa.tournament.name')->label('Tournament'),
|
TextColumn::make('country.name')->label('Country')
|
||||||
TextColumn::make('ss_team_name')->label('Name'),
|
->sortable(),
|
||||||
|
TextColumn::make('tournament_rosa.tournament.name')->label('Tournament')
|
||||||
|
->sortable(),
|
||||||
|
TextColumn::make('ss_team_name')->label('Name')
|
||||||
|
->sortable(),
|
||||||
TextColumn::make('updated_at')->dateTime('Y-m-d H:i:s')
|
TextColumn::make('updated_at')->dateTime('Y-m-d H:i:s')
|
||||||
|
->sortable()
|
||||||
|
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
Filter::make('filters')
|
Filter::make('filters')
|
||||||
|
|||||||
+4
-2
@@ -13,8 +13,10 @@ class SofaScoreTasksTable
|
|||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('id')->badge()->alignCenter()->width('1rem'),
|
TextColumn::make('id')->badge()->alignCenter()->width('1rem')
|
||||||
TextColumn::make('name'),
|
->sortable(),
|
||||||
|
TextColumn::make('name')
|
||||||
|
->sortable(),
|
||||||
IconColumn::make('sport.icon')
|
IconColumn::make('sport.icon')
|
||||||
->label('')
|
->label('')
|
||||||
->grow(false)
|
->grow(false)
|
||||||
|
|||||||
+5
-1
@@ -33,18 +33,22 @@ class StatisticFixturesTable
|
|||||||
}),
|
}),
|
||||||
TextColumn::make('league.name')
|
TextColumn::make('league.name')
|
||||||
->label('League')
|
->label('League')
|
||||||
|
->sortable()
|
||||||
->searchable()
|
->searchable()
|
||||||
->description(
|
->description(
|
||||||
fn($record) => $record->league->sofascore_category->name
|
fn($record) => $record->league->sofascore_category->name
|
||||||
),
|
),
|
||||||
TextColumn::make('starttime')->dateTime('Y-m-d H:i'),
|
TextColumn::make('starttime')->dateTime('Y-m-d H:i')
|
||||||
|
->sortable(),
|
||||||
TextColumn::make('home.ss_team_name')
|
TextColumn::make('home.ss_team_name')
|
||||||
->tooltip(fn($record) => $record->home_id)
|
->tooltip(fn($record) => $record->home_id)
|
||||||
->color('primary')
|
->color('primary')
|
||||||
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
TextColumn::make('away.ss_team_name')
|
TextColumn::make('away.ss_team_name')
|
||||||
->tooltip(fn($record) => $record->away_id)
|
->tooltip(fn($record) => $record->away_id)
|
||||||
->color('success')
|
->color('success')
|
||||||
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
TextColumn::make('updated_at')->alignCenter()->date(),
|
TextColumn::make('updated_at')->alignCenter()->date(),
|
||||||
])
|
])
|
||||||
|
|||||||
+2
-1
@@ -30,7 +30,8 @@ class StatistikoDetailsTable
|
|||||||
->searchable(
|
->searchable(
|
||||||
query: fn($query, $search) => $query->orWhere('ss_player_id', (int) $search)
|
query: fn($query, $search) => $query->orWhere('ss_player_id', (int) $search)
|
||||||
),
|
),
|
||||||
TextColumn::make('positions.name')->badge()->color('warning'),
|
TextColumn::make('positions.name')->badge()->color('warning')
|
||||||
|
->sortable(),
|
||||||
TextColumn::make('team.ss_team_name')->prefix('Team: ')->color('teal'),
|
TextColumn::make('team.ss_team_name')->prefix('Team: ')->color('teal'),
|
||||||
TextColumn::make('team.country.name')->prefix('Country: ')->color('teal'),
|
TextColumn::make('team.country.name')->prefix('Country: ')->color('teal'),
|
||||||
TextColumn::make('birthdate')->prefix('Birthdate: '),
|
TextColumn::make('birthdate')->prefix('Birthdate: '),
|
||||||
|
|||||||
+7
-1
@@ -28,21 +28,27 @@ class StatistikoEventsTable
|
|||||||
->striped()
|
->striped()
|
||||||
->columns([
|
->columns([
|
||||||
IconColumn::make('sport_id')
|
IconColumn::make('sport_id')
|
||||||
|
->sortable()
|
||||||
->label('')
|
->label('')
|
||||||
->icon(fn(string $state): string => match ($state) {
|
->icon(fn(string $state): string => match ($state) {
|
||||||
'1' => 'icon-soccerball',
|
'1' => 'icon-soccerball',
|
||||||
}),
|
}),
|
||||||
TextColumn::make('match_id')->color('info')->icon('phosphor-copy')->copyable()
|
TextColumn::make('match_id')->color('info')->icon('phosphor-copy')->copyable()
|
||||||
|
->sortable()
|
||||||
->searchable(
|
->searchable(
|
||||||
query: fn($query, $search) => $query->orWhere('match_id', (int) $search)
|
query: fn($query, $search) => $query->orWhere('match_id', (int) $search)
|
||||||
),
|
),
|
||||||
TextColumn::make('league.name')
|
TextColumn::make('league.name')
|
||||||
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
TextColumn::make('home.ss_team_name')->color('info')
|
TextColumn::make('home.ss_team_name')->color('info')
|
||||||
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
TextColumn::make('away.ss_team_name')->color('success')
|
TextColumn::make('away.ss_team_name')->color('success')
|
||||||
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
TextColumn::make('starttime')->dateTime('Y-m-d H:i'),
|
TextColumn::make('starttime')->dateTime('Y-m-d H:i')
|
||||||
|
->sortable(),
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
Filter::make('event_filters')
|
Filter::make('event_filters')
|
||||||
|
|||||||
+5
-1
@@ -24,6 +24,7 @@ class StatistikoImportsTable
|
|||||||
->striped()
|
->striped()
|
||||||
->columns([
|
->columns([
|
||||||
SelectColumn::make('data_type')
|
SelectColumn::make('data_type')
|
||||||
|
->sortable()
|
||||||
->native(false)
|
->native(false)
|
||||||
->allowOptionsHtml()
|
->allowOptionsHtml()
|
||||||
->options([
|
->options([
|
||||||
@@ -33,14 +34,17 @@ class StatistikoImportsTable
|
|||||||
'events' => '<span class="text-green-500">Events History</span>',
|
'events' => '<span class="text-green-500">Events History</span>',
|
||||||
]),
|
]),
|
||||||
TextColumn::make('file_name_original')
|
TextColumn::make('file_name_original')
|
||||||
|
->sortable()
|
||||||
->searchable()
|
->searchable()
|
||||||
->label('Name'),
|
->label('Name'),
|
||||||
IconColumn::make('has_run')
|
IconColumn::make('has_run')
|
||||||
->label('Imported')
|
->label('Imported')
|
||||||
|
->sortable()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->boolean()
|
->boolean()
|
||||||
->falseColor('gray'),
|
->falseColor('gray'),
|
||||||
TextColumn::make('created_at')->dateTime(),
|
TextColumn::make('created_at')->dateTime()
|
||||||
|
->sortable(),
|
||||||
|
|
||||||
])
|
])
|
||||||
->defaultSort('id', direction: 'desc')
|
->defaultSort('id', direction: 'desc')
|
||||||
|
|||||||
+7
-2
@@ -16,21 +16,26 @@ class StatistikoPlayersTable
|
|||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('match_id')->color('info')->icon('phosphor-copy')->copyable()
|
TextColumn::make('match_id')->color('info')->icon('phosphor-copy')->copyable()
|
||||||
|
->sortable()
|
||||||
->searchable(
|
->searchable(
|
||||||
query: fn($query, $search) => $query->orWhere('match_id', (int) $search)
|
query: fn($query, $search) => $query->orWhere('match_id', (int) $search)
|
||||||
),
|
),
|
||||||
TextColumn::make('ss_player_id')
|
TextColumn::make('ss_player_id')
|
||||||
|
->sortable()
|
||||||
->label('Player Id')
|
->label('Player Id')
|
||||||
->color('success')->icon('phosphor-copy')->copyable()
|
->color('success')->icon('phosphor-copy')->copyable()
|
||||||
->searchable(
|
->searchable(
|
||||||
query: fn($query, $search) => $query->orWhere('ss_player_id', (int) $search)
|
query: fn($query, $search) => $query->orWhere('ss_player_id', (int) $search)
|
||||||
),
|
),
|
||||||
TextColumn::make('details.player_name')
|
TextColumn::make('details.player_name')
|
||||||
|
->sortable()
|
||||||
->label('Player')
|
->label('Player')
|
||||||
->searchable()
|
->searchable()
|
||||||
->tooltip(fn($record) => $record->details->full_name),
|
->tooltip(fn($record) => $record->details->full_name),
|
||||||
TextColumn::make('event.home.ss_team_name')->searchable()->color('primary'),
|
TextColumn::make('event.home.ss_team_name')->searchable()->color('primary')
|
||||||
TextColumn::make('event.away.ss_team_name')->searchable()->color('success'),
|
->sortable(),
|
||||||
|
TextColumn::make('event.away.ss_team_name')->searchable()->color('success')
|
||||||
|
->sortable(),
|
||||||
])
|
])
|
||||||
// ->filters([
|
// ->filters([
|
||||||
// Filter::make('player_filters')
|
// Filter::make('player_filters')
|
||||||
|
|||||||
Reference in new issue
Block a user