wip
This commit is contained in:
1 parent
fc0f18ba73
commit
558430114a
11 files changed
+98
-135
No files matched your search
@@ -25,7 +25,6 @@ class DaysTournament
|
|||||||
|
|
||||||
foreach ($days as $d) {
|
foreach ($days as $d) {
|
||||||
|
|
||||||
$langsam = $d['run_slow'];
|
|
||||||
$sport_id = $d['sport_id'];
|
$sport_id = $d['sport_id'];
|
||||||
$day = $d['day'];
|
$day = $d['day'];
|
||||||
$slug = $d['slug'];
|
$slug = $d['slug'];
|
||||||
@@ -48,7 +47,7 @@ class DaysTournament
|
|||||||
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/sport/$slug/scheduled-tournaments/$day/page/$page";
|
$url = Nuh::$options['base_url'] . "api/v1/sport/$slug/scheduled-tournaments/$day/page/$page";
|
||||||
|
|
||||||
Sleeper::rand($langsam);
|
Sleeper::rand();
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
@@ -146,9 +145,9 @@ class DaysTournament
|
|||||||
]);
|
]);
|
||||||
$tournaments_counter++;
|
$tournaments_counter++;
|
||||||
|
|
||||||
if ($debug) {
|
// if ($debug) {
|
||||||
Notice::note('tournament: ' . $tournament['name'], 'p');
|
// Notice::note('tournament: ' . $tournament['name'], 'p');
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DAY TOURNAMENT
|
* DAY TOURNAMENT
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ class Grapper
|
|||||||
|
|
||||||
foreach ($days as $d) {
|
foreach ($days as $d) {
|
||||||
|
|
||||||
$langsam = $d['run_slow'];
|
|
||||||
|
|
||||||
$day = $d['day'];
|
$day = $d['day'];
|
||||||
|
|
||||||
$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();
|
||||||
@@ -77,7 +75,7 @@ class Grapper
|
|||||||
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/statistics";
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/statistics";
|
||||||
|
|
||||||
Sleeper::rand($langsam);
|
Sleeper::rand();
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
@@ -94,7 +92,7 @@ class Grapper
|
|||||||
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/lineups";
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/lineups";
|
||||||
|
|
||||||
Sleeper::rand($langsam);
|
Sleeper::rand();
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
@@ -111,7 +109,7 @@ class Grapper
|
|||||||
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/odds/1/all";
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/odds/1/all";
|
||||||
|
|
||||||
Sleeper::rand($langsam);
|
Sleeper::rand();
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
@@ -128,7 +126,7 @@ class Grapper
|
|||||||
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/incidents";
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/incidents";
|
||||||
|
|
||||||
Sleeper::rand($langsam);
|
Sleeper::rand();
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ class LoadDays
|
|||||||
$dates[] = [
|
$dates[] = [
|
||||||
'day' => Carbon::now()->subDay()->format('Y-m-d'),
|
'day' => Carbon::now()->subDay()->format('Y-m-d'),
|
||||||
'slug' => $task->sport->ss_slug,
|
'slug' => $task->sport->ss_slug,
|
||||||
'run_slow' => $task->run_slow,
|
|
||||||
'sport_id' => $task->sport_id,
|
'sport_id' => $task->sport_id,
|
||||||
'run_repeatedly' => $task->run_repeatedly,
|
'run_repeatedly' => $task->run_repeatedly,
|
||||||
];
|
];
|
||||||
@@ -44,7 +43,6 @@ class LoadDays
|
|||||||
$dates[] = [
|
$dates[] = [
|
||||||
'day' => self::validateDate($task->day_from),
|
'day' => self::validateDate($task->day_from),
|
||||||
'slug' => $task->sport->ss_slug,
|
'slug' => $task->sport->ss_slug,
|
||||||
'run_slow' => $task->run_slow,
|
|
||||||
'sport_id' => $task->sport_id,
|
'sport_id' => $task->sport_id,
|
||||||
'run_repeatedly' => $task->run_repeatedly,
|
'run_repeatedly' => $task->run_repeatedly,
|
||||||
];
|
];
|
||||||
@@ -68,7 +66,6 @@ class LoadDays
|
|||||||
$dates[] = [
|
$dates[] = [
|
||||||
'day' => $from->format('Y-m-d'),
|
'day' => $from->format('Y-m-d'),
|
||||||
'slug' => $task->sport->ss_slug,
|
'slug' => $task->sport->ss_slug,
|
||||||
'run_slow' => $task->run_slow,
|
|
||||||
'sport_id' => $task->sport_id,
|
'sport_id' => $task->sport_id,
|
||||||
'run_repeatedly' => $task->run_repeatedly,
|
'run_repeatedly' => $task->run_repeatedly,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -2,29 +2,15 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
||||||
|
|
||||||
use App\Console\Commands\Nuh;
|
|
||||||
use App\Utilities\Notice;
|
|
||||||
|
|
||||||
class Sleeper
|
class Sleeper
|
||||||
{
|
{
|
||||||
public static function rand(bool $langsam = false)
|
public static function rand($langsam = false)
|
||||||
{
|
{
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
$langsam = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($langsam) {
|
if ($langsam) {
|
||||||
$sleep = rand(2000000, 60000000);
|
$sleep = rand(3000000, 6000000);
|
||||||
} else {
|
} else {
|
||||||
$sleep = rand(500000, 1000000);
|
$sleep = rand(500000, 1000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($debug) {
|
|
||||||
Notice::note("sleeping $sleep msec", 'y');
|
|
||||||
}
|
|
||||||
|
|
||||||
usleep($sleep);
|
usleep($sleep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+5
-6
@@ -23,33 +23,32 @@ class SofaScoreTasksTable
|
|||||||
->label('')
|
->label('')
|
||||||
->grow(false)
|
->grow(false)
|
||||||
->width(30)
|
->width(30)
|
||||||
->icon(fn ($record) => $record->sport->icon),
|
->icon(fn($record) => $record->sport->icon),
|
||||||
TextColumn::make('sport.name'),
|
TextColumn::make('sport.name'),
|
||||||
IconColumn::make('compleated')
|
IconColumn::make('compleated')
|
||||||
->width('1rem')
|
->width('1rem')
|
||||||
->label('Status')
|
->label('Status')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->icon(fn (string $state): string => match ($state) {
|
->icon(fn(string $state): string => match ($state) {
|
||||||
'0' => 'phosphor-pause-fill',
|
'0' => 'phosphor-pause-fill',
|
||||||
'1' => 'phosphor-check-fat-fill',
|
'1' => 'phosphor-check-fat-fill',
|
||||||
})
|
})
|
||||||
->color(fn (string $state): string => match ($state) {
|
->color(fn(string $state): string => match ($state) {
|
||||||
'0' => 'gray',
|
'0' => 'gray',
|
||||||
'1' => 'success',
|
'1' => 'success',
|
||||||
}),
|
}),
|
||||||
TextColumn::make('mode')
|
TextColumn::make('mode')
|
||||||
->label('Grapping dates')
|
->label('Grapping dates')
|
||||||
->formatStateUsing(fn (string $state, $record): string => match ($state) {
|
->formatStateUsing(fn(string $state, $record): string => match ($state) {
|
||||||
'yesterday' => 'Every yesterday',
|
'yesterday' => 'Every yesterday',
|
||||||
'date' => $record->day_from,
|
'date' => $record->day_from,
|
||||||
'range' => $record->day_from.' <=> '.$record->day_to,
|
'range' => $record->day_from . ' <=> ' . $record->day_to,
|
||||||
}),
|
}),
|
||||||
ToggleColumn::make('is_active')
|
ToggleColumn::make('is_active')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->afterStateUpdated(function ($record) {
|
->afterStateUpdated(function ($record) {
|
||||||
SofaScoreTask::where('id', $record->id)->update(['compleated' => 0]);
|
SofaScoreTask::where('id', $record->id)->update(['compleated' => 0]);
|
||||||
}),
|
}),
|
||||||
ToggleColumn::make('run_slow')->alignCenter(),
|
|
||||||
ToggleColumn::make('run_repeatedly')->alignCenter(),
|
ToggleColumn::make('run_repeatedly')->alignCenter(),
|
||||||
TextColumn::make('duration'),
|
TextColumn::make('duration'),
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -43,15 +43,15 @@ use Illuminate\Support\Facades\DB;
|
|||||||
|
|
||||||
class EventsTable
|
class EventsTable
|
||||||
{
|
{
|
||||||
public static $user;
|
public static array $user;
|
||||||
|
|
||||||
public static $bettype_settings;
|
public static array $bettype_settings;
|
||||||
|
|
||||||
public static $slots;
|
public static array $slots;
|
||||||
|
|
||||||
public static $bookmaker;
|
public static array $bookmaker;
|
||||||
|
|
||||||
public static $filter;
|
public static array $filter;
|
||||||
|
|
||||||
public static function configure(Table $table): Table
|
public static function configure(Table $table): Table
|
||||||
{
|
{
|
||||||
@@ -69,106 +69,106 @@ class EventsTable
|
|||||||
->columns([
|
->columns([
|
||||||
IconColumn::make('sport.icon')
|
IconColumn::make('sport.icon')
|
||||||
->label('')
|
->label('')
|
||||||
->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'),
|
||||||
|
|
||||||
MatchIds::make('ids')->grow(false)->visibleFrom('xl')
|
MatchIds::make('ids')->grow(false)->visibleFrom('xl')
|
||||||
->visible(fn () => auth()->user()->hasRole('super_admin')),
|
->visible(fn() => auth()->user()->hasRole('super_admin')),
|
||||||
ColumnStarttime::make('start'),
|
ColumnStarttime::make('start'),
|
||||||
TextColumn::make('country.name')
|
TextColumn::make('country.name')
|
||||||
->label('League')
|
->label('League')
|
||||||
->wrap()
|
->wrap()
|
||||||
->hidden(fn () => auth()->user()->sport_id == 5)
|
->hidden(fn() => auth()->user()->sport_id == 5)
|
||||||
->color('gray')
|
->color('gray')
|
||||||
->icon(fn ($record) => $record->country?->icon)
|
->icon(fn($record) => $record->country?->icon)
|
||||||
->description(fn ($record) => ucwords($record->group?->name)),
|
->description(fn($record) => ucwords($record->group?->name)),
|
||||||
|
|
||||||
EventColumn::make('event'),
|
EventColumn::make('event'),
|
||||||
|
|
||||||
TooltipOdds::make('ml')->bettype('odds_2ways')->label('')->visible(fn () => in_array('odds_2ways', self::$bettype_settings)),
|
TooltipOdds::make('ml')->bettype('odds_2ways')->label('')->visible(fn() => in_array('odds_2ways', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_2ways')->bettype('odds_2ways')
|
ColumnOdds::make('odds_2ways')->bettype('odds_2ways')
|
||||||
->visible(fn () => in_array('odds_2ways', self::$bettype_settings))
|
->visible(fn() => in_array('odds_2ways', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('ML'),
|
->label('ML'),
|
||||||
|
|
||||||
TooltipOdds::make('mls1')->bettype('odds_2ways_s1')->label('')->visible(fn () => in_array('odds_2ways_s1', self::$bettype_settings)),
|
TooltipOdds::make('mls1')->bettype('odds_2ways_s1')->label('')->visible(fn() => in_array('odds_2ways_s1', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_2ways_s1')->bettype('odds_2ways_s1')
|
ColumnOdds::make('odds_2ways_s1')->bettype('odds_2ways_s1')
|
||||||
->visible(fn () => in_array('odds_2ways_s1', self::$bettype_settings))
|
->visible(fn() => in_array('odds_2ways_s1', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('ML S1'),
|
->label('ML S1'),
|
||||||
|
|
||||||
TooltipOdds::make('1x2')->bettype('odds_3ways')->label('')->visible(fn () => in_array('odds_3ways', self::$bettype_settings)),
|
TooltipOdds::make('1x2')->bettype('odds_3ways')->label('')->visible(fn() => in_array('odds_3ways', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_3ways')
|
ColumnOdds::make('odds_3ways')
|
||||||
->bettype('odds_3ways')
|
->bettype('odds_3ways')
|
||||||
->visible(fn () => in_array('odds_3ways', self::$bettype_settings))
|
->visible(fn() => in_array('odds_3ways', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('1X2'),
|
->label('1X2'),
|
||||||
|
|
||||||
TooltipOdds::make('1x2ht')->bettype('odds_3ways_ht')->label('')->visible(fn () => in_array('odds_3ways_ht', self::$bettype_settings)),
|
TooltipOdds::make('1x2ht')->bettype('odds_3ways_ht')->label('')->visible(fn() => in_array('odds_3ways_ht', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_3ways_ht')->bettype('odds_3ways_ht')
|
ColumnOdds::make('odds_3ways_ht')->bettype('odds_3ways_ht')
|
||||||
->visible(fn () => in_array('odds_3ways_ht', self::$bettype_settings))
|
->visible(fn() => in_array('odds_3ways_ht', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('1X2 HT'),
|
->label('1X2 HT'),
|
||||||
|
|
||||||
TooltipOdds::make('total')->bettype('odds_totals')->label('')->visible(fn () => in_array('odds_totals', self::$bettype_settings)),
|
TooltipOdds::make('total')->bettype('odds_totals')->label('')->visible(fn() => in_array('odds_totals', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_totals')->bettype('odds_totals')
|
ColumnOdds::make('odds_totals')->bettype('odds_totals')
|
||||||
->visible(fn () => in_array('odds_totals', self::$bettype_settings))
|
->visible(fn() => in_array('odds_totals', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('Totals'),
|
->label('Totals'),
|
||||||
|
|
||||||
TooltipOdds::make('total_ht')->bettype('odds_totals_ht')->label('')->visible(fn () => in_array('odds_totals_ht', self::$bettype_settings)),
|
TooltipOdds::make('total_ht')->bettype('odds_totals_ht')->label('')->visible(fn() => in_array('odds_totals_ht', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_totals_ht')->bettype('odds_totals_ht')
|
ColumnOdds::make('odds_totals_ht')->bettype('odds_totals_ht')
|
||||||
->visible(fn () => in_array('odds_totals_ht', self::$bettype_settings))
|
->visible(fn() => in_array('odds_totals_ht', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('Totals HT'),
|
->label('Totals HT'),
|
||||||
|
|
||||||
TooltipOdds::make('total_q1')->bettype('odds_totals_q1')->label('')->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings)),
|
TooltipOdds::make('total_q1')->bettype('odds_totals_q1')->label('')->visible(fn() => in_array('odds_totals_q1', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_totals_q1')->bettype('odds_totals_q1')
|
ColumnOdds::make('odds_totals_q1')->bettype('odds_totals_q1')
|
||||||
->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings))
|
->visible(fn() => in_array('odds_totals_q1', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->label('Totals Q1'),
|
->label('Totals Q1'),
|
||||||
|
|
||||||
TooltipOdds::make('points')->bettype('odds_points')->label('')->visible(fn () => in_array('odds_points', self::$bettype_settings)),
|
TooltipOdds::make('points')->bettype('odds_points')->label('')->visible(fn() => in_array('odds_points', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_points')->bettype('odds_points')
|
ColumnOdds::make('odds_points')->bettype('odds_points')
|
||||||
->visible(fn () => in_array('odds_points', self::$bettype_settings))
|
->visible(fn() => in_array('odds_points', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('Points'),
|
->label('Points'),
|
||||||
|
|
||||||
TooltipOdds::make('points_ht')->bettype('odds_points_ht')->label('')->visible(fn () => in_array('odds_points_ht', self::$bettype_settings)),
|
TooltipOdds::make('points_ht')->bettype('odds_points_ht')->label('')->visible(fn() => in_array('odds_points_ht', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_points_ht')->bettype('odds_points_ht')
|
ColumnOdds::make('odds_points_ht')->bettype('odds_points_ht')
|
||||||
->visible(fn () => in_array('odds_points_ht', self::$bettype_settings))
|
->visible(fn() => in_array('odds_points_ht', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('Points HT'),
|
->label('Points HT'),
|
||||||
|
|
||||||
TooltipOdds::make('points_q1')->bettype('odds_points_q1')->label('')->visible(fn () => in_array('odds_points_q1', self::$bettype_settings)),
|
TooltipOdds::make('points_q1')->bettype('odds_points_q1')->label('')->visible(fn() => in_array('odds_points_q1', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_points_q1')->bettype('odds_points_q1')
|
ColumnOdds::make('odds_points_q1')->bettype('odds_points_q1')
|
||||||
->visible(fn () => in_array('odds_points_q1', self::$bettype_settings))
|
->visible(fn() => in_array('odds_points_q1', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('Points Q1'),
|
->label('Points Q1'),
|
||||||
|
|
||||||
TooltipOdds::make('ggng')->bettype('odds_ggng')->label('')->visible(fn () => in_array('odds_ggng', self::$bettype_settings)),
|
TooltipOdds::make('ggng')->bettype('odds_ggng')->label('')->visible(fn() => in_array('odds_ggng', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_ggng')->bettype('odds_ggng')
|
ColumnOdds::make('odds_ggng')->bettype('odds_ggng')
|
||||||
->visible(fn () => \in_array('odds_ggng', self::$bettype_settings))
|
->visible(fn() => \in_array('odds_ggng', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('Goal No Goal'),
|
->label('Goal No Goal'),
|
||||||
|
|
||||||
TooltipOdds::make('dc')->bettype('odds_dc')->label('')->visible(fn () => in_array('odds_dc', self::$bettype_settings)),
|
TooltipOdds::make('dc')->bettype('odds_dc')->label('')->visible(fn() => in_array('odds_dc', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_dc')->bettype('odds_dc')
|
ColumnOdds::make('odds_dc')->bettype('odds_dc')
|
||||||
->visible(fn () => \in_array('odds_dc', self::$bettype_settings))
|
->visible(fn() => \in_array('odds_dc', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('Double Chance'),
|
->label('Double Chance'),
|
||||||
|
|
||||||
TooltipOdds::make('tq')->bettype('odds_tq')->label('')->visible(fn () => in_array('odds_tq', self::$bettype_settings)),
|
TooltipOdds::make('tq')->bettype('odds_tq')->label('')->visible(fn() => in_array('odds_tq', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_tq')->bettype('odds_tq')
|
ColumnOdds::make('odds_tq')->bettype('odds_tq')
|
||||||
->visible(fn () => \in_array('odds_tq', self::$bettype_settings))
|
->visible(fn() => \in_array('odds_tq', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('To Qualify'),
|
->label('To Qualify'),
|
||||||
|
|
||||||
TooltipOdds::make('dnb')->bettype('odds_dnb')->label('')->visible(fn () => in_array('odds_dnb', self::$bettype_settings)),
|
TooltipOdds::make('dnb')->bettype('odds_dnb')->label('')->visible(fn() => in_array('odds_dnb', self::$bettype_settings)),
|
||||||
ColumnOdds::make('odds_dnb')->bettype('odds_dnb')
|
ColumnOdds::make('odds_dnb')->bettype('odds_dnb')
|
||||||
->visible(fn () => \in_array('odds_dnb', self::$bettype_settings))
|
->visible(fn() => \in_array('odds_dnb', self::$bettype_settings))
|
||||||
->verticalAlignment(VerticalAlignment::Start)
|
->verticalAlignment(VerticalAlignment::Start)
|
||||||
->label('Draw No Bet'),
|
->label('Draw No Bet'),
|
||||||
])
|
])
|
||||||
@@ -184,7 +184,7 @@ class EventsTable
|
|||||||
Hidden::make('filter_stars'),
|
Hidden::make('filter_stars'),
|
||||||
Hidden::make('filter_notes'),
|
Hidden::make('filter_notes'),
|
||||||
Hidden::make('filter_periode'),
|
Hidden::make('filter_periode'),
|
||||||
Select::make(name: 'country_id')
|
Select::make('country_id')
|
||||||
->placeholder('Country')
|
->placeholder('Country')
|
||||||
->prefixIcon('phosphor-flag')
|
->prefixIcon('phosphor-flag')
|
||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
@@ -214,7 +214,7 @@ class EventsTable
|
|||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
->label('')
|
->label('')
|
||||||
->preload()
|
->preload()
|
||||||
->options(fn () => ClientGroupList::where('sport_id', auth()->user()->sport_id)
|
->options(fn() => ClientGroupList::where('sport_id', auth()->user()->sport_id)
|
||||||
->where('client_id', auth()->user()->client_id)
|
->where('client_id', auth()->user()->client_id)
|
||||||
->pluck('name', 'id'))
|
->pluck('name', 'id'))
|
||||||
->live(),
|
->live(),
|
||||||
@@ -257,7 +257,7 @@ class EventsTable
|
|||||||
|
|
||||||
$arr = [];
|
$arr = [];
|
||||||
foreach ($res as $val) {
|
foreach ($res as $val) {
|
||||||
$arr[$val->competition_group_id] = $val->country?->name.' '.$val->competition_group?->name;
|
$arr[$val->competition_group_id] = $val->country?->name . ' ' . $val->competition_group?->name;
|
||||||
}
|
}
|
||||||
asort($arr);
|
asort($arr);
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ class EventsTable
|
|||||||
->live(),
|
->live(),
|
||||||
|
|
||||||
Select::make('competition_group_id')
|
Select::make('competition_group_id')
|
||||||
->visible(fn () => auth()->user()->sport_id == 5)
|
->visible(fn() => auth()->user()->sport_id == 5)
|
||||||
->placeholder('Tournament')
|
->placeholder('Tournament')
|
||||||
->prefixIcon('phosphor-trophy')
|
->prefixIcon('phosphor-trophy')
|
||||||
->columnSpan(2)
|
->columnSpan(2)
|
||||||
@@ -317,7 +317,7 @@ class EventsTable
|
|||||||
->prefixIcon('phosphor-funnel')
|
->prefixIcon('phosphor-funnel')
|
||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
->allowHtml()
|
->allowHtml()
|
||||||
->options(fn () => CompareOptions::load()),
|
->options(fn() => CompareOptions::load()),
|
||||||
])
|
])
|
||||||
->query(function (Builder $query, array $data): Builder {
|
->query(function (Builder $query, array $data): Builder {
|
||||||
return $query->when(
|
return $query->when(
|
||||||
@@ -327,7 +327,7 @@ class EventsTable
|
|||||||
}
|
}
|
||||||
)->when(
|
)->when(
|
||||||
$data['competition_group_id'],
|
$data['competition_group_id'],
|
||||||
fn (Builder $query, $competition_group_id) => $query->whereIn('competition_group_id', $competition_group_id)
|
fn(Builder $query, $competition_group_id) => $query->whereIn('competition_group_id', $competition_group_id)
|
||||||
|
|
||||||
)->when(
|
)->when(
|
||||||
$data['client_group_list_id'],
|
$data['client_group_list_id'],
|
||||||
@@ -493,7 +493,7 @@ class EventsTable
|
|||||||
|
|
||||||
if ($data['client_group_list_id'] ?? null) {
|
if ($data['client_group_list_id'] ?? null) {
|
||||||
$client_group_list_name = ClientGroupList::where('id', $data['client_group_list_id'])->value('name');
|
$client_group_list_name = ClientGroupList::where('id', $data['client_group_list_id'])->value('name');
|
||||||
$indicators[] = Indicator::make('Custom Group: '.$client_group_list_name)->removeField('client_group_list_id')->color('info');
|
$indicators[] = Indicator::make('Custom Group: ' . $client_group_list_name)->removeField('client_group_list_id')->color('info');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($data['filter_stars'] ?? null) {
|
if ($data['filter_stars'] ?? null) {
|
||||||
@@ -510,17 +510,17 @@ class EventsTable
|
|||||||
|
|
||||||
if ($data['filter_alarm_green'] ?? null) {
|
if ($data['filter_alarm_green'] ?? null) {
|
||||||
$title = OddsTable::where('name', $data['filter_alarm_green'])->value('title');
|
$title = OddsTable::where('name', $data['filter_alarm_green'])->value('title');
|
||||||
$indicators[] = Indicator::make('Alarms: '.$title)->removeField('filter_alarm_green')->color('success');
|
$indicators[] = Indicator::make('Alarms: ' . $title)->removeField('filter_alarm_green')->color('success');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($data['filter_alarm_yellow'] ?? null) {
|
if ($data['filter_alarm_yellow'] ?? null) {
|
||||||
$title = OddsTable::where('name', $data['filter_alarm_yellow'])->value('title');
|
$title = OddsTable::where('name', $data['filter_alarm_yellow'])->value('title');
|
||||||
$indicators[] = Indicator::make('Alarms: '.$title)->removeField('filter_alarm_yellow')->color('info');
|
$indicators[] = Indicator::make('Alarms: ' . $title)->removeField('filter_alarm_yellow')->color('info');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($data['filter_alarm_red'] ?? null) {
|
if ($data['filter_alarm_red'] ?? null) {
|
||||||
$title = OddsTable::where('name', $data['filter_alarm_red'])->value('title');
|
$title = OddsTable::where('name', $data['filter_alarm_red'])->value('title');
|
||||||
$indicators[] = Indicator::make('Alarms: '.$title)->removeField('filter_alarm_red')->color('danger');
|
$indicators[] = Indicator::make('Alarms: ' . $title)->removeField('filter_alarm_red')->color('danger');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($data['starttime_period'] ?? null) {
|
if ($data['starttime_period'] ?? null) {
|
||||||
@@ -530,7 +530,7 @@ class EventsTable
|
|||||||
$text .= Carbon::parse($span['start'])->format('d. M.');
|
$text .= Carbon::parse($span['start'])->format('d. M.');
|
||||||
}
|
}
|
||||||
if ($span['end'] ?? null) {
|
if ($span['end'] ?? null) {
|
||||||
$text .= ' - '.Carbon::parse($span['end'])->format('d. M.');
|
$text .= ' - ' . Carbon::parse($span['end'])->format('d. M.');
|
||||||
}
|
}
|
||||||
if ($text) {
|
if ($text) {
|
||||||
$indicators[] = Indicator::make($text)->removeField('starttime_period.start')->color('info');
|
$indicators[] = Indicator::make($text)->removeField('starttime_period.start')->color('info');
|
||||||
@@ -549,16 +549,16 @@ class EventsTable
|
|||||||
if ($data['favorit_threshold'] ?? null) {
|
if ($data['favorit_threshold'] ?? null) {
|
||||||
switch (auth()->user()->sport_id) {
|
switch (auth()->user()->sport_id) {
|
||||||
case 1:
|
case 1:
|
||||||
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
$indicators[] = Indicator::make('1X2 Fav <= ' . $data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
$indicators[] = Indicator::make('1X2 Fav <= ' . $data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$indicators[] = Indicator::make('HC Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
$indicators[] = Indicator::make('HC Fav <= ' . $data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
$indicators[] = Indicator::make('ML Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
$indicators[] = Indicator::make('ML Fav <= ' . $data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -633,7 +633,7 @@ class EventsTable
|
|||||||
->modalIcon('phosphor-note-pencil-duotone')
|
->modalIcon('phosphor-note-pencil-duotone')
|
||||||
->modalWidth(Width::Large)
|
->modalWidth(Width::Large)
|
||||||
->modalSubmitActionLabel('Save')
|
->modalSubmitActionLabel('Save')
|
||||||
->extraModalFooterActions(fn (Action $action, $record) => $record->event_user_note->isEmpty() ? [] : [$action->makeModalSubmitAction('Delete', arguments: ['delete' => true])->color('danger')])
|
->extraModalFooterActions(fn(Action $action, $record) => $record->event_user_note->isEmpty() ? [] : [$action->makeModalSubmitAction('Delete', arguments: ['delete' => true])->color('danger')])
|
||||||
->fillForm(data: function ($record) {
|
->fillForm(data: function ($record) {
|
||||||
foreach ($record->event_user_note as $value) {
|
foreach ($record->event_user_note as $value) {
|
||||||
if ($value->user_id == auth()->user()->id && $value->bookmaker_id == auth()->user()->bookmaker_id) {
|
if ($value->user_id == auth()->user()->id && $value->bookmaker_id == auth()->user()->bookmaker_id) {
|
||||||
@@ -654,7 +654,7 @@ class EventsTable
|
|||||||
])
|
])
|
||||||
->icon('phosphor-note-pencil-duotone')
|
->icon('phosphor-note-pencil-duotone')
|
||||||
->iconButton()
|
->iconButton()
|
||||||
->tooltip(fn ($record) => view('filament.resources.events.tooltip.event-user-note-tooltip', ['notes' => $record->event_user_note]))
|
->tooltip(fn($record) => view('filament.resources.events.tooltip.event-user-note-tooltip', ['notes' => $record->event_user_note]))
|
||||||
->action(function ($record, array $data, $arguments = []) {
|
->action(function ($record, array $data, $arguments = []) {
|
||||||
if ($arguments) {
|
if ($arguments) {
|
||||||
EventUserNote::where('id', $data['event_user_note_id'])->delete();
|
EventUserNote::where('id', $data['event_user_note_id'])->delete();
|
||||||
@@ -675,14 +675,14 @@ class EventsTable
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->color(fn ($record) => $record->event_user_note->isEmpty() ? 'gray' : 'info'),
|
->color(fn($record) => $record->event_user_note->isEmpty() ? 'gray' : 'info'),
|
||||||
ActionGroup::make([
|
ActionGroup::make([
|
||||||
DeleteAction::make()->visible(fn () => auth()->user()->hasRole('super_admin')),
|
DeleteAction::make()->visible(fn() => auth()->user()->hasRole('super_admin')),
|
||||||
Action::make('txodds_odds')
|
Action::make('txodds_odds')
|
||||||
->label('TxOdds')
|
->label('TxOdds')
|
||||||
->disabled(fn () => ! auth()->user()->hasRole('super_admin'))
|
->disabled(fn() => ! auth()->user()->hasRole('super_admin'))
|
||||||
->icon('phosphor-arrow-square-out')
|
->icon('phosphor-arrow-square-out')
|
||||||
->url(fn ($record): string => route('txodds_odds', ['sportid' => $record->sport_id, 'txoddsid' => $record->id]))
|
->url(fn($record): string => route('txodds_odds', ['sportid' => $record->sport_id, 'txoddsid' => $record->id]))
|
||||||
->openUrlInNewTab(),
|
->openUrlInNewTab(),
|
||||||
Action::make('swap_elements')
|
Action::make('swap_elements')
|
||||||
->icon('phosphor-swap')
|
->icon('phosphor-swap')
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ use App\Models\MultilineSetting;
|
|||||||
|
|
||||||
class LoadMultiline
|
class LoadMultiline
|
||||||
{
|
{
|
||||||
public static $user;
|
|
||||||
|
|
||||||
public static function load()
|
public static function load()
|
||||||
{
|
{
|
||||||
$cb = ComparingBookmaker::where('sport_id', auth()->user()->sport_id)
|
$cb = ComparingBookmaker::where('sport_id', auth()->user()->sport_id)
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ class SofaScoreTask extends Model
|
|||||||
'is_active',
|
'is_active',
|
||||||
'compleated',
|
'compleated',
|
||||||
'run_repeatedly',
|
'run_repeatedly',
|
||||||
'run_slow',
|
|
||||||
'last_start',
|
'last_start',
|
||||||
'last_end',
|
'last_end',
|
||||||
];
|
];
|
||||||
|
|||||||
+22
-34
@@ -1,8 +1,19 @@
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
"1")
|
''|*[!0-9]*)
|
||||||
|
echo ""
|
||||||
|
echo "--------------------------"
|
||||||
|
echo "GRAPPER SOFASCORE"
|
||||||
|
echo "--------------------------"
|
||||||
|
echo "taks one parameter"
|
||||||
|
echo "use id sofa_score_tasks table"
|
||||||
|
echo "--------------------------"
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
# AUTO GRAPPER SOFASCORE (debug)
|
# AUTO GRAPPER SOFASCORE (debug)
|
||||||
|
|
||||||
echo "\n⚽ process function $1 sofa_score_task $2"
|
echo "\n⚽ sofa_score_task $1"
|
||||||
|
|
||||||
echo "\n⚽ close all vpn"
|
echo "\n⚽ close all vpn"
|
||||||
killall ssh
|
killall ssh
|
||||||
@@ -11,54 +22,31 @@ case "$1" in
|
|||||||
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
|
||||||
|
|
||||||
echo "\n⚽ copy settings"
|
echo "\n⚽ copy settings"
|
||||||
php artisan nuh --d --f 67 --fun=2 --task=$2
|
php artisan nuh --d --f 67 --fun=2 --task=$1
|
||||||
|
|
||||||
echo "\n⚽ close vpn"
|
echo "\n⚽ close vpn"
|
||||||
killall ssh
|
killall ssh
|
||||||
|
|
||||||
echo "\n⚽ start task"
|
echo "\n⚽ start task"
|
||||||
php artisan nuh --d --f 67 --fun=7 --task=$2
|
php artisan nuh --d --f 67 --fun=7 --task=$1
|
||||||
|
|
||||||
echo "\n⚽ get tournaments for the day"
|
echo "\n⚽ get tournaments for the day"
|
||||||
php artisan nuh --d --f 67 --fun=5 --task=$2
|
php artisan nuh --d --f 67 --fun=5 --task=$1
|
||||||
|
|
||||||
echo "\n⚽ grapper events for the day"
|
echo "\n⚽ grapper events for the day"
|
||||||
php artisan nuh --d --f 67 --fun=6 --task=$2
|
php artisan nuh --d --f 67 --fun=6 --task=$1
|
||||||
|
|
||||||
echo "\n⚽ create zip archive"
|
echo "\n⚽ create zip archive"
|
||||||
php artisan nuh --d --f 67 --fun=3 --task=$2
|
php artisan nuh --d --f 67 --fun=3 --task=$1
|
||||||
|
|
||||||
echo "\n⚽ mail archive"
|
echo "\n⚽ mail archive"
|
||||||
php artisan nuh --d --f 67 --fun=4 --task=$2
|
php artisan nuh --d --f 67 --fun=4 --task=$1
|
||||||
|
|
||||||
echo "\n⚽ end task"
|
echo "\n⚽ end task"
|
||||||
php artisan nuh --d --f 67 --fun=8 --task=$2
|
php artisan nuh --d --f 67 --fun=8 --task=$1
|
||||||
|
|
||||||
echo "\n😎 done :)"
|
echo "\n😎 done :)"
|
||||||
;;
|
|
||||||
"2")
|
|
||||||
# AUTO GRAPPER SOFASCORE (production no debug and 10s breaks)
|
|
||||||
echo "\n⚽ process function $1 sofa_score_task $2"
|
|
||||||
killall ssh
|
|
||||||
ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190
|
|
||||||
php artisan nuh --f 67 --fun=2 --task=$2
|
|
||||||
killall ssh
|
|
||||||
php artisan nuh --f 67 --fun=7 --task=$2
|
|
||||||
php artisan nuh --f 67 --fun=5 --task=$2
|
|
||||||
php artisan nuh --f 67 --fun=6 --task=$2
|
|
||||||
php artisan nuh --f 67 --fun=3 --task=$2
|
|
||||||
php artisan nuh --f 67 --fun=4 --task=$2
|
|
||||||
php artisan nuh --f 67 --fun=8 --task=$2
|
|
||||||
echo "\n😎 done :)"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo ""
|
|
||||||
echo "--------------------------"
|
|
||||||
echo "apple damon grapper sofascore"
|
|
||||||
echo "--------------------------"
|
|
||||||
echo "1 => debug max 5sec intervals"
|
|
||||||
echo "2 => prod max 10sec intervals"
|
|
||||||
echo "--------------------------"
|
|
||||||
echo ""
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
"laravel/framework": "*",
|
"laravel/framework": "*",
|
||||||
"laravel/tinker": "*",
|
"laravel/tinker": "*",
|
||||||
"mongodb/laravel-mongodb": "^5.1",
|
"mongodb/laravel-mongodb": "^5.1",
|
||||||
"mongodb/mongodb": "^2.0",
|
"mongodb/mongodb": "^2.3",
|
||||||
"outhebox/blade-flags": "*",
|
"outhebox/blade-flags": "*",
|
||||||
"spatie/simple-excel": "^3.9",
|
"spatie/simple-excel": "^3.9",
|
||||||
"stevebauman/location": "*",
|
"stevebauman/location": "*",
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ return new class extends Migration
|
|||||||
$table->boolean('is_active')->default(0);
|
$table->boolean('is_active')->default(0);
|
||||||
$table->boolean('compleated')->default(0);
|
$table->boolean('compleated')->default(0);
|
||||||
$table->boolean('run_repeatedly')->default(0);
|
$table->boolean('run_repeatedly')->default(0);
|
||||||
$table->boolean('run_slow')->default(0);
|
|
||||||
$table->dateTime('last_start')->nullable();
|
$table->dateTime('last_start')->nullable();
|
||||||
$table->dateTime('last_end')->nullable();
|
$table->dateTime('last_end')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|||||||
Reference in new issue
Block a user