remove lastcontrol timestamp
This commit is contained in:
1 parent
cc8ddb544b
commit
0742b6c19f
65 files changed
+132
-313
No files matched your search
@@ -30,7 +30,9 @@ class Odds
|
||||
Notice::note('BETSAPI ODDS '.Nuh::$options['sport'], 'b');
|
||||
}
|
||||
|
||||
$sources = [126 => 'bet365', 83 => 'pinnaclesports'];
|
||||
$sources = [83 => 'pinnaclesports'];
|
||||
|
||||
$flags = [];
|
||||
|
||||
if ($single) {
|
||||
$events = Event::where('id', Nuh::$options['id'])->where('betsapi_id', '>', 0)->select('id', 'sport_id', 'bet365_id', 'betsapi_id', 'starttime')->get();
|
||||
@@ -84,6 +86,8 @@ class Odds
|
||||
|
||||
$odds = array_merge($odds, $base);
|
||||
|
||||
$flags['odds_3ways'][] = $event->id;
|
||||
|
||||
$res = Odds3way::where('event_id', $event->id)->where('bookmaker_id', $bookmaker_id)->first();
|
||||
|
||||
if (! $res) {
|
||||
@@ -92,10 +96,7 @@ class Odds
|
||||
$res->h3w = $odds['h3w'];
|
||||
$res->a3w = $odds['d3w'];
|
||||
$res->d3w = $odds['a3w'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -120,10 +121,7 @@ class Odds
|
||||
$res->h3w = $odds['h3w'];
|
||||
$res->a3w = $odds['d3w'];
|
||||
$res->d3w = $odds['a3w'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -135,5 +133,9 @@ class Odds
|
||||
Supervisor::where('id', Nuh::$options['supervisor_id'])->update(['lastcall' => time()]);
|
||||
|
||||
}
|
||||
// needs check
|
||||
foreach ($flags as $table => $event_ids) {
|
||||
DB::table($table)->where('bookmaker_id', $bookmaker_id)->whereNotIn('event_id', $event_ids)->update(['flags' => 0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user