wip del err
This commit is contained in:
1 parent
812736ca9a
commit
9bcd4432c6
1210 files changed
-220941
No files matched your search
@@ -1,62 +0,0 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
$lastcall = Nuh::$options['lastcall'] > time() - 600 ? '&last='.Nuh::$options['lastcall'] : '&last='.time() - 600;
|
||||
|
||||
/**
|
||||
* SOCCER
|
||||
*/
|
||||
$tables = OddsTable::where('soccer', 1)->pluck('name');
|
||||
|
||||
$url = 'https://xml2.txodds.com/feed/boid_states.php?ident=betaid1&passwd=Dy59vpRC'.$lastcall;
|
||||
|
||||
$data = Xml::load($url);
|
||||
|
||||
if (is_array($data)) {
|
||||
|
||||
Supervisor::where('id', Nuh::$options['supervisor_id'])->update(['lastcall' => (int) $data['timestamp']]);
|
||||
|
||||
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'.$lastcall;
|
||||
|
||||
$data = Xml::load($url);
|
||||
|
||||
if (is_array($data)) {
|
||||
|
||||
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']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user