This commit is contained in:
salam committed 2026-01-08 12:51:12 +01:00
1 parent fa0e2cdef1
commit 4f9125ef12
13 files changed
+100 -64

No files matched your search

+47 -16
View File
@@ -88,7 +88,6 @@ class Odds
*************************************************/
$debug = Nuh::$options['d'] ?? 0;
$echo = Nuh::$options['e'] ?? 0;
switch (Nuh::$options['sport_id']) {
case 1:
@@ -118,38 +117,74 @@ class Odds
*************************************************/
$url = 'https://xml2.txodds.com/feed/odds/xml.php?'.Nuh::$AUTHTOKEN.'&all_odds=2&spid='.Nuh::$options['sport_id'];
$_calls = [];
if (Nuh::$options['event_id']) {
// by id
$_calls[] = $url."&ot=$markets&peid=".Nuh::$options['event_id'];
if (Nuh::$options['id']) {
if ($debug) {
Notice::note('BY ID', 'p');
}
/**
* BY ID
*/
$_calls[] = $url."&ot=$markets&peid=".Nuh::$options['id'];
} elseif (Nuh::$options['a']) {
// all existing
if ($debug) {
Notice::note('ALL EXISTING', 'p');
}
/**
* ALL EXISTING
*/
$res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->pluck('id');
foreach ($res as $id) {
$_calls[] = $url."&ot=$markets&peid=".$id;
}
} elseif (Nuh::$options['g']) {
// one week per group names (mybee fastes)
if ($debug) {
Notice::note('PER GROUP_ID', 'p');
}
/**
* PER GROUP_ID
*
* with from-to days
*/
$groupids = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->groupBy('group_id')->pluck('group_id');
foreach ($groupids as $groupid) {
$_calls[] = $url = 'https://xml2.txodds.com/feed/odds/xml.php?'.Nuh::$AUTHTOKEN.'&all_odds=2&ot='.$markets.'&days=0,1&pgid='.$groupid;
$_calls[] = $url = 'https://xml2.txodds.com/feed/odds/xml.php?'.Nuh::$AUTHTOKEN.'&all_odds=2&ot='.$markets.'&days='.Nuh::$options['days_from'].','.Nuh::$options['days_to'].'&pgid='.$groupid;
}
} elseif (Nuh::$options['b']) {
// one day
} elseif (Nuh::$options['t']) {
if ($debug) {
Notice::note('TODAY', 'p');
}
/**
* TODAY
*/
$res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(1)->toDateTimeString())->pluck('id');
foreach ($res as $id) {
$_calls[] = $url."&ot=$markets&peid=".$id;
}
} elseif (Nuh::$options['w']) {
// one week
if ($debug) {
Notice::note('ONE WEEK FROM NOW', 'p');
}
/**
* ONE WEEK
*/
$res = Event::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 {
// all with lastcall
$_calls[] = $url."&ot=$markets&last=".Nuh::$options['lastcall'];
if ($debug) {
Notice::note('WITH LASTCALL Parameter', 'p');
}
/**
* WITH LASTCALL Parameter
* with from-to days
*/
$_calls[] = $url."&ot=$markets&days=".Nuh::$options['days_from'].','.Nuh::$options['days_to'].'&last='.Nuh::$options['lastcall'];
}
dd($_calls);
/*************************************************
* CALL
*************************************************/
@@ -160,10 +195,6 @@ class Odds
$data = Xml::load($url);
if ($echo) {
dd($data);
}
if ($debug) {
Notice::note('counter: '.count($_calls).'/'.$counter, 'g');
}