add PDOException on updated odds
This commit is contained in:
1 parent
b35c8c48e3
commit
980b716271
15 files changed
+284
-21
No files matched your search
@@ -19,16 +19,14 @@ class TxoddsFlags
|
||||
Notice::note('Txodds Markets Status', 'b');
|
||||
}
|
||||
|
||||
if (Nuh::$options['lastcall'] >= strtotime('-1 hour')) {
|
||||
Nuh::$options['lastcall'] = 0;
|
||||
}
|
||||
$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&last='.Nuh::$options['lastcall'];
|
||||
$url = 'https://xml2.txodds.com/feed/boid_states.php?ident=betaid1&passwd=Dy59vpRC'.$lastcall;
|
||||
|
||||
$data = Xml::load($url);
|
||||
|
||||
@@ -43,16 +41,16 @@ class TxoddsFlags
|
||||
*/
|
||||
$tables = OddsTable::where('other', 1)->pluck('name');
|
||||
|
||||
$url = 'https://xml2.txodds.com/feed/boid_states.php?ident=betaid2&passwd=Dy59vpRC&last='.Nuh::$options['lastcall'];
|
||||
$url = 'https://xml2.txodds.com/feed/boid_states.php?ident=betaid2&passwd=Dy59vpRC'.$lastcall;
|
||||
|
||||
$data = Xml::load($url);
|
||||
|
||||
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']]);
|
||||
}
|
||||
}
|
||||
|
||||
Supervisor::where('id', Nuh::$options['supervisor_id'])->update(['lastcall' => time()]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user