diff --git a/app/Console/Commands/Grapper/TxOdds/Fixtures.php b/app/Console/Commands/Grapper/TxOdds/Fixtures.php index cbd3c658..8911d700 100644 --- a/app/Console/Commands/Grapper/TxOdds/Fixtures.php +++ b/app/Console/Commands/Grapper/TxOdds/Fixtures.php @@ -54,7 +54,7 @@ class Fixtures if (now()->between(today(), today()->addHour())) { Nuh::$options['days_to'] = 2; } else { - Nuh::$options['days_to'] = 2; + Nuh::$options['days_to'] = 1; } } elseif ($week) { Nuh::$options['days_from'] = 0; diff --git a/app/Console/Commands/Services/Services.php b/app/Console/Commands/Services/Services.php index 9af5d46f..c897c06d 100644 --- a/app/Console/Commands/Services/Services.php +++ b/app/Console/Commands/Services/Services.php @@ -7,7 +7,7 @@ use App\Console\Commands\Services\Tasks\DBMapper; use App\Console\Commands\Services\Tasks\GenerateAlarms; use App\Console\Commands\Services\Tasks\GenerateSetting; use App\Console\Commands\Services\Tasks\MarketsList; -use App\Console\Commands\Services\Tasks\MarketsState; +use App\Console\Commands\Services\Tasks\TxoddsFlags; class Services { @@ -17,8 +17,8 @@ class Services case 'Txodds Markets': MarketsList::call(); break; - case 'Txodds Offerstatus': - MarketsState::call(); + case 'Txodds Flags': + TxoddsFlags::call(); break; case 'DB Mapper': DBMapper::run(); diff --git a/app/Console/Commands/Services/Tasks/Alarm/AlarmLoadOdds.php b/app/Console/Commands/Services/Tasks/Alarm/AlarmLoadOdds.php index 0048c2cb..15659562 100644 --- a/app/Console/Commands/Services/Tasks/Alarm/AlarmLoadOdds.php +++ b/app/Console/Commands/Services/Tasks/Alarm/AlarmLoadOdds.php @@ -8,8 +8,11 @@ class AlarmLoadOdds { public static function get($event_id, $table, $oddnames) { - - $res = DB::table($table)->where('flags', 1)->where('event_id', $event_id)->get(); + if (in_array($table, ['odds_points', 'odds_points_ht', 'odds_points_q1', 'odds_totals', 'odds_totals_ht', 'odds_totals_q1'])) { + $res = DB::table($table)->where('active_spread', 1)->where('flags', 1)->where('event_id', $event_id)->get(); + } else { + $res = DB::table($table)->where('flags', 1)->where('event_id', $event_id)->get(); + } $arr = []; diff --git a/app/Console/Commands/Services/Tasks/MarketsState.php b/app/Console/Commands/Services/Tasks/MarketsState.php deleted file mode 100644 index 00e98660..00000000 --- a/app/Console/Commands/Services/Tasks/MarketsState.php +++ /dev/null @@ -1,112 +0,0 @@ -update(['lastcall' => time()]); - - // if (Txodds::$_config['soccer-others'] == 'soccer') { - // $lc_file = '/var/www/NuhOdds/src/Txodds/Lastcalls/flags_soccer.txt'; - // $lastcall = file_get_contents($lc_file); - // $url = "https://xml2.txodds.com/feed/boid_states.php?ident=betaid1&passwd=Dy59vpRC&last=$lastcall"; - // } elseif (Txodds::$_config['soccer-others'] == 'others') { - // $lc_file = '/var/www/NuhOdds/src/Txodds/Lastcalls/flags_other.txt'; - // $lastcall = file_get_contents($lc_file); - // $url = "https://xml2.txodds.com/feed/boid_states.php?ident=betaid2&passwd=Dy59vpRC&last=$lastcall"; - // } - - // if ($lastcall < time() + 60) { - // $lastcall = time() - 60; - // } - - // if (Database::$debug == 1) { - // echo Utilities::note($url); - // } - - // $xml = Loader::xmlLoader($url); - - // file_put_contents($lc_file, (int) $xml['timestamp']); - - // $_status = []; - - // foreach ($xml->boid as $_boid) { - // $offerid = (int) $_boid['id']; - // $flags = (int) $_boid['flags']; - - // $_status[$offerid] = $flags; - // } - - // $_tables = ['bai_3way', 'bai_2way', 'bai_totals', 'bai_totals_ht', 'bai_totals_qt', 'bai_points', 'bai_points_ht', 'bai_points_qt']; - - // foreach ($_tables as $key => $table) { - // if (Txodds::$_config['soccer-others'] == 'soccer') { - // $tmp = DbFunction::select($table, ['offerid', 'flags'], ['AND' => ['orig' => 0, 'sportid' => 1]]); - // } elseif (Txodds::$_config['soccer-others'] == 'others') { - // $tmp = DbFunction::select($table, ['offerid', 'flags'], ['AND' => ['orig' => 0, 'sportid[!]' => 1]]); - // } - - // // foreach ($tmp as $key => $value) { - // // $offerid = $value["offerid"]; - // // $flags = $value["flags"]; - // // if (isset($_status[$offerid])) { - // // DbFunction::secureUpdate($table, ["flags"=>$flags], ["offerid"=>$offerid]); - // // } - // // } - - // foreach ($tmp as $key => $value) { - // $offerid = $value['offerid']; - // $old_flags = $value['flags']; - // if (isset($_status[$offerid])) { - // if ($_status[$offerid] == 1) { - // if ($old_flags == 0) { - // DbFunction::secureUpdate($table, ['flags' => 1], ['offerid' => $offerid]); - // } - // } else { - // if ($old_flags == 1) { - // DbFunction::secureUpdate($table, ['flags' => 0], ['offerid' => $offerid]); - // } - // } - // } - // } - // } - } -} diff --git a/app/Console/Commands/Services/Tasks/TxoddsFlags.php b/app/Console/Commands/Services/Tasks/TxoddsFlags.php new file mode 100644 index 00000000..ff8ab1b0 --- /dev/null +++ b/app/Console/Commands/Services/Tasks/TxoddsFlags.php @@ -0,0 +1,54 @@ +pluck('name'); + + $url = 'https://xml2.txodds.com/feed/boid_states.php?ident=betaid1&passwd=Dy59vpRC&last='.Nuh::$options['lastcall']; + + $data = Xml::load($url); + + foreach ($data as $row) { + foreach ($tables as $table) { + DB::table($table)->where('offer_id', (int) $row['id'])->update(['last_updated' => $row['last_updated'], 'flags' => $row['flags']]); + } + } + + /** + * OTHER + */ + $tables = OddsTable::where('other', 1)->pluck('name'); + + $url = 'https://xml2.txodds.com/feed/boid_states.php?ident=betaid2&passwd=Dy59vpRC&last='.Nuh::$options['lastcall']; + + $data = Xml::load($url); + + foreach ($data as $row) { + foreach ($tables as $table) { + DB::table($table)->where('offer_id', (int) $row['id'])->update(['last_updated' => $row['last_updated'], 'flags' => $row['flags']]); + } + } + + Supervisor::where('id', Nuh::$options['supervisor_id'])->update(['lastcall' => time()]); + } +} diff --git a/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php b/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php index cf9de3cc..d56a9b43 100644 --- a/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php +++ b/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php @@ -44,7 +44,7 @@ class SupervisorsTable }), Stack::make([ SelectColumn::make('name') - ->disablePlaceholderSelection() + ->selectablePlaceholder(false) ->hidden(function (ListSupervisors $livewire) { return $livewire->tableFilters['provider_id']['value'] == 8; }) @@ -74,7 +74,7 @@ class SupervisorsTable */ return [ 'Txodds Markets' => 'Txodds Markets', - 'Txodds Offerstatus' => 'Txodds Offerstatus', + 'Txodds Flags' => 'Txodds Flags', 'DB Mapper' => 'DB Mapper', 'Generate Setting' => 'Generate Setting', 'Generate Alarms' => 'Generate Alarms', diff --git a/app/Livewire/KontoSwitcher.php b/app/Livewire/KontoSwitcher.php index be64d30c..4c4f2e75 100644 --- a/app/Livewire/KontoSwitcher.php +++ b/app/Livewire/KontoSwitcher.php @@ -25,7 +25,7 @@ class KontoSwitcher extends Component $bookmaker_id = array_shift($bookmakers); - User::where('id', auth()->user()->id)->update(['provider_id' => $provider_id, 'bookmaker_id' => $bookmaker_id, 'client_id' => $client_id]); + User::where('id', auth()->user()->id)->update(['sport_id' => 1, 'provider_id' => $provider_id, 'bookmaker_id' => $bookmaker_id, 'client_id' => $client_id]); $this->js('window.location.reload()'); } diff --git a/composer.lock b/composer.lock index 9a9d2739..f1924c5e 100644 --- a/composer.lock +++ b/composer.lock @@ -2731,16 +2731,16 @@ }, { "name": "laravel/framework", - "version": "v12.48.1", + "version": "v12.49.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "0f0974a9769378ccd9c9935c09b9927f3a606830" + "reference": "4bde4530545111d8bdd1de6f545fa8824039fcb5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/0f0974a9769378ccd9c9935c09b9927f3a606830", - "reference": "0f0974a9769378ccd9c9935c09b9927f3a606830", + "url": "https://api.github.com/repos/laravel/framework/zipball/4bde4530545111d8bdd1de6f545fa8824039fcb5", + "reference": "4bde4530545111d8bdd1de6f545fa8824039fcb5", "shasum": "" }, "require": { @@ -2949,20 +2949,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-01-20T16:12:36+00:00" + "time": "2026-01-28T03:40:49+00:00" }, { "name": "laravel/prompts", - "version": "v0.3.10", + "version": "v0.3.11", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "360ba095ef9f51017473505191fbd4ab73e1cab3" + "reference": "dd2a2ed95acacbcccd32fd98dee4c946ae7a7217" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/360ba095ef9f51017473505191fbd4ab73e1cab3", - "reference": "360ba095ef9f51017473505191fbd4ab73e1cab3", + "url": "https://api.github.com/repos/laravel/prompts/zipball/dd2a2ed95acacbcccd32fd98dee4c946ae7a7217", + "reference": "dd2a2ed95acacbcccd32fd98dee4c946ae7a7217", "shasum": "" }, "require": { @@ -3006,9 +3006,9 @@ "description": "Add beautiful and user-friendly forms to your command-line applications.", "support": { "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.3.10" + "source": "https://github.com/laravel/prompts/tree/v0.3.11" }, - "time": "2026-01-13T20:29:29+00:00" + "time": "2026-01-27T02:55:06+00:00" }, { "name": "laravel/serializable-closure", @@ -9214,16 +9214,16 @@ }, { "name": "brianium/paratest", - "version": "v7.8.4", + "version": "v7.8.5", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "130a9bf0e269ee5f5b320108f794ad03e275cad4" + "reference": "9b324c8fc319cf9728b581c7a90e1c8f6361c5e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/130a9bf0e269ee5f5b320108f794ad03e275cad4", - "reference": "130a9bf0e269ee5f5b320108f794ad03e275cad4", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/9b324c8fc319cf9728b581c7a90e1c8f6361c5e5", + "reference": "9b324c8fc319cf9728b581c7a90e1c8f6361c5e5", "shasum": "" }, "require": { @@ -9231,27 +9231,27 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^1.2.0", + "fidry/cpu-core-counter": "^1.3.0", "jean85/pretty-package-versions": "^2.1.1", - "php": "~8.2.0 || ~8.3.0 || ~8.4.0", - "phpunit/php-code-coverage": "^11.0.10", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "phpunit/php-code-coverage": "^11.0.12", "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-timer": "^7.0.1", - "phpunit/phpunit": "^11.5.24", + "phpunit/phpunit": "^11.5.46", "sebastian/environment": "^7.2.1", - "symfony/console": "^6.4.22 || ^7.3.0", - "symfony/process": "^6.4.20 || ^7.3.0" + "symfony/console": "^6.4.22 || ^7.3.4 || ^8.0.3", + "symfony/process": "^6.4.20 || ^7.3.4 || ^8.0.3" }, "require-dev": { "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "phpstan/phpstan": "^2.1.17", + "phpstan/phpstan": "^2.1.33", "phpstan/phpstan-deprecation-rules": "^2.0.3", - "phpstan/phpstan-phpunit": "^2.0.6", - "phpstan/phpstan-strict-rules": "^2.0.4", - "squizlabs/php_codesniffer": "^3.13.2", - "symfony/filesystem": "^6.4.13 || ^7.3.0" + "phpstan/phpstan-phpunit": "^2.0.11", + "phpstan/phpstan-strict-rules": "^2.0.7", + "squizlabs/php_codesniffer": "^3.13.5", + "symfony/filesystem": "^6.4.13 || ^7.3.2 || ^8.0.1" }, "bin": [ "bin/paratest", @@ -9291,7 +9291,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.8.4" + "source": "https://github.com/paratestphp/paratest/tree/v7.8.5" }, "funding": [ { @@ -9303,7 +9303,7 @@ "type": "paypal" } ], - "time": "2025-06-23T06:07:21+00:00" + "time": "2026-01-08T08:02:38+00:00" }, { "name": "doctrine/deprecations", @@ -10159,38 +10159,38 @@ }, { "name": "pestphp/pest", - "version": "v3.8.4", + "version": "v3.8.5", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "72cf695554420e21858cda831d5db193db102574" + "reference": "7796630eafcfd1c02660cecdde3bc6984fbf01f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/72cf695554420e21858cda831d5db193db102574", - "reference": "72cf695554420e21858cda831d5db193db102574", + "url": "https://api.github.com/repos/pestphp/pest/zipball/7796630eafcfd1c02660cecdde3bc6984fbf01f4", + "reference": "7796630eafcfd1c02660cecdde3bc6984fbf01f4", "shasum": "" }, "require": { - "brianium/paratest": "^7.8.4", - "nunomaduro/collision": "^8.8.2", - "nunomaduro/termwind": "^2.3.1", + "brianium/paratest": "^7.8.5", + "nunomaduro/collision": "^8.8.3", + "nunomaduro/termwind": "^2.3.3", "pestphp/pest-plugin": "^3.0.0", "pestphp/pest-plugin-arch": "^3.1.1", "pestphp/pest-plugin-mutate": "^3.0.5", "php": "^8.2.0", - "phpunit/phpunit": "^11.5.33" + "phpunit/phpunit": "^11.5.50" }, "conflict": { "filp/whoops": "<2.16.0", - "phpunit/phpunit": ">11.5.33", + "phpunit/phpunit": ">11.5.50", "sebastian/exporter": "<6.0.0", "webmozart/assert": "<1.11.0" }, "require-dev": { "pestphp/pest-dev-tools": "^3.4.0", "pestphp/pest-plugin-type-coverage": "^3.6.1", - "symfony/process": "^7.3.0" + "symfony/process": "^7.4.4" }, "bin": [ "bin/pest" @@ -10255,7 +10255,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v3.8.4" + "source": "https://github.com/pestphp/pest/tree/v3.8.5" }, "funding": [ { @@ -10267,7 +10267,7 @@ "type": "github" } ], - "time": "2025-08-20T19:12:42+00:00" + "time": "2026-01-28T01:33:45+00:00" }, { "name": "pestphp/pest-plugin", @@ -11359,16 +11359,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.33", + "version": "11.5.50", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "5965e9ff57546cb9137c0ff6aa78cb7442b05cf6" + "reference": "fdfc727f0fcacfeb8fcb30c7e5da173125b58be3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5965e9ff57546cb9137c0ff6aa78cb7442b05cf6", - "reference": "5965e9ff57546cb9137c0ff6aa78cb7442b05cf6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fdfc727f0fcacfeb8fcb30c7e5da173125b58be3", + "reference": "fdfc727f0fcacfeb8fcb30c7e5da173125b58be3", "shasum": "" }, "require": { @@ -11382,17 +11382,17 @@ "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.2", - "phpunit/php-code-coverage": "^11.0.10", + "phpunit/php-code-coverage": "^11.0.12", "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-invoker": "^5.0.1", "phpunit/php-text-template": "^4.0.1", "phpunit/php-timer": "^7.0.1", "sebastian/cli-parser": "^3.0.2", "sebastian/code-unit": "^3.0.3", - "sebastian/comparator": "^6.3.2", + "sebastian/comparator": "^6.3.3", "sebastian/diff": "^6.0.2", "sebastian/environment": "^7.2.1", - "sebastian/exporter": "^6.3.0", + "sebastian/exporter": "^6.3.2", "sebastian/global-state": "^7.0.2", "sebastian/object-enumerator": "^6.0.1", "sebastian/type": "^5.1.3", @@ -11440,7 +11440,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.33" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.50" }, "funding": [ { @@ -11464,7 +11464,7 @@ "type": "tidelift" } ], - "time": "2025-08-16T05:19:02+00:00" + "time": "2026-01-27T05:59:18+00:00" }, { "name": "rector/rector", @@ -12814,12 +12814,12 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^8.3" }, - "platform-dev": [], - "plugin-api-version": "2.6.0" + "platform-dev": {}, + "plugin-api-version": "2.9.0" } diff --git a/database/seeders/SupervisorSeeder.php b/database/seeders/SupervisorSeeder.php index 72f99efd..8bb40d91 100644 --- a/database/seeders/SupervisorSeeder.php +++ b/database/seeders/SupervisorSeeder.php @@ -68,7 +68,7 @@ class SupervisorSeeder extends Seeder (52, '', 10, 0, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-16 12:05:14', '2026-01-16 12:05:14'), (53, 'Generate Setting', 7, 0, NULL, 30, 0, '0.02', NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-16 12:05:14', '2026-01-27 13:39:46'), (54, 'Generate Alarms', 7, 1, NULL, 30, 0, '0', NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-16 12:05:14', '2026-01-27 13:42:39'), - (55, 'Txodds Offerstatus', 7, NULL, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-27 11:25:56', '2026-01-27 11:26:05'); + (55, 'Txodds Flags', 7, NULL, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-27 11:25:56', '2026-01-27 11:26:05'); "; DB::unprepared($sql); } diff --git a/resources/views/components/alarm-neutral.blade.php b/resources/views/components/alarm-neutral.blade.php index 88fc5af7..cda3fd03 100644 --- a/resources/views/components/alarm-neutral.blade.php +++ b/resources/views/components/alarm-neutral.blade.php @@ -1,4 +1,4 @@
+ class="text-primary-600 dark:text-primary-500 border border-primary-300 dark:border-primary-500/30 bg-primary-50 dark:bg-primary-800/20 rounded"> {{ $slot }}
diff --git a/resources/views/filament/resources/events/widgets/alarm-widget.blade.php b/resources/views/filament/resources/events/widgets/alarm-widget.blade.php index e88dec3a..efdae6df 100644 --- a/resources/views/filament/resources/events/widgets/alarm-widget.blade.php +++ b/resources/views/filament/resources/events/widgets/alarm-widget.blade.php @@ -1,21 +1,22 @@ -
+
{{ $title }}
- - @if($red) -
{{ $red }}
+ + @if ($red) +
{{ $red }}
@else - 0 + 0 @endif - @if($yellow) -
{{ $yellow }}
+ @if ($yellow) +
{{ $yellow }}
@else - 0 + 0 @endif - @if($green) -
{{ $green }}
+ @if ($green) +
{{ $green }}
@else - 0 + 0 @endif
diff --git a/setup.sh b/setup.sh index 096431e9..982ccdaa 100755 --- a/setup.sh +++ b/setup.sh @@ -67,7 +67,11 @@ case "$1" in php artisan nuh --d --f 19 ;; "10") + echo "" + echo "" echo "!! WITH PROXY !!" + echo "" + echo "" php artisan nuh --d --t --f 1 php artisan nuh --d --t --f 2 # php artisan nuh --d --t --f 20 @@ -85,7 +89,7 @@ case "$1" in # php artisan nuh --d --f --p 13 # php artisan nuh --d --f --p 14 # php artisan nuh --d --f --p 15 - php artisan nuh --d --f --p 16 + # php artisan nuh --d --f --p 16 # php artisan nuh --d --f --p 17 # php artisan nuh --d --f --p 18 # php artisan nuh --d --f --p 19