This commit is contained in:
salam committed 2026-01-28 10:12:21 +01:00
1 parent 320079c2a1
commit 99b657eb3a
12 files changed
+137 -187

No files matched your search

@@ -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;
+3 -3
View File
@@ -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();
@@ -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 = [];
@@ -1,112 +0,0 @@
<?php
namespace App\Console\Commands\Services\Tasks;
use App\Console\Commands\Nuh;
use App\Console\Commands\Xml;
use App\Models\Supervisor;
use App\Utilities\Notice;
class MarketsState
{
public static function call()
{
$debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note('Txodds Markets Status', 'b');
}
foreach (['betaid1', 'betaid2'] as $kontos) {
$url = 'https://xml2.txodds.com/feed/boid_states.php?ident='.$kontos.'&passwd=Dy59vpRC&last='.Nuh::$options['lastcall'];
$data = Xml::load($url);
// odds_2ways
// odds_2ways_s1
// odds_3ways
// odds_3ways_ht
// odds_dc
// odds_dnb
// odds_ggng
// odds_points
// odds_points_ht
// odds_points_q1
// odds_totals
// odds_totals_ht
// odds_totals_q1
// odds_tq
foreach ($data as $row) {
}
}
Supervisor::where('id', Nuh::$options['supervisor_id'])->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]);
// }
// }
// }
// }
// }
}
}
@@ -0,0 +1,54 @@
<?php
namespace App\Console\Commands\Services\Tasks;
use App\Console\Commands\Nuh;
use App\Console\Commands\Xml;
use App\Models\OddsTable;
use App\Models\Supervisor;
use App\Utilities\Notice;
use Illuminate\Support\Facades\DB;
class TxoddsFlags
{
public static function call()
{
$debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note('Txodds Markets Status', 'b');
}
/**
* SOCCER
*/
$tables = OddsTable::where('soccer', 1)->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()]);
}
}
@@ -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',
+1 -1
View File
@@ -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()');
}