add txodds markets as a resource

This commit is contained in:
salam committed 2026-01-13 07:29:08 +01:00
1 parent e14404ec8b
commit 5fa1d02dbd
26 files changed
+921 -55

No files matched your search

+22 -18
View File
@@ -96,8 +96,6 @@ class Odds
*************************************************/
$debug = Nuh::$options['d'] ?? 0;
switch (Nuh::$options['sport_id']) {
case 1:
/**
@@ -149,6 +147,13 @@ class Odds
break;
}
/*************************************************
* use_lastcall
*************************************************/
if (Nuh::$options['use_lastcall']) {
$lastcall = Nuh::$options['lastcall'] ? '&last='.Nuh::$options['lastcall'] : '';
}
/*************************************************
* URL
*************************************************/
@@ -165,26 +170,15 @@ class Odds
Notice::note("BY ID \nsport_id: ".Nuh::$options['sport_id'], 'p');
}
/**
* by SINGLE ID
* by specific ID
*/
$_calls[] = $url."&ot=$markets&peid=".Nuh::$options['id'];
} elseif (Nuh::$options['a']) {
if ($debug) {
Notice::note("ALL \nsport_id: ".Nuh::$options['sport_id'], 'p');
}
/**
* ALL by ID
*/
$res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>', Carbon::now()->toDateTimeString())->pluck('id');
foreach ($res as $id) {
$_calls[] = $url."&ot=$markets&peid=".$id;
}
} elseif (Nuh::$options['g']) {
if ($debug) {
Notice::note("GROUP_ID \nsport_id: ".Nuh::$options['sport_id'], 'p');
}
/**
* PER GROUP_ID
* per group_id
* with from-to
*/
$groupids = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->groupBy('group_id')->pluck('group_id');
@@ -197,7 +191,7 @@ class Odds
}
/**
* TODAY
* today
*/
$from = Carbon::now()->toDateTimeString();
$to = Carbon::now()->addDays(1)->toDateTimeString();
@@ -211,13 +205,23 @@ class Odds
Notice::note("WEEK \nsport_id: ".Nuh::$options['sport_id'], 'p');
}
/**
* ONE WEEK
* week from now
*/
$res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(7)->toDateTimeString())->pluck('id');
foreach ($res as $id) {
$_calls[] = $url."&ot=$markets&peid=".$id;
}
} else {
if ($debug) {
Notice::note("ALL \nsport_id: ".Nuh::$options['sport_id'], 'p');
}
/**
* ALL by ID
*/
$res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>', Carbon::now()->toDateTimeString())->pluck('id');
foreach ($res as $id) {
$_calls[] = $url."&ot=$markets&peid=".$id;
}
if ($debug) {
Notice::note("LASTCALL \nsport_id: ".Nuh::$options['sport_id'], 'p');
}
@@ -226,7 +230,7 @@ class Odds
* with from-to days
*/
$_calls[] = $url.'&spid='.Nuh::$options['sport_id']."&ot=$markets&days=".Nuh::$options['days_from'].','.Nuh::$options['days_to'].'&last='.Nuh::$options['lastcall'];
$_calls[] = $url.'&spid='.Nuh::$options['sport_id']."&ot=$markets&days=".Nuh::$options['days_from'].','.Nuh::$options['days_to'].$lastcall;
}
/*************************************************