remove lastcontrol timestamp
This commit is contained in:
1 parent
cc8ddb544b
commit
0742b6c19f
65 files changed
+132
-313
No files matched your search
@@ -31,6 +31,8 @@ class Bet365
|
||||
|
||||
$sportmap = Sport::map('bapi', 1, [1, 2, 3, 5]);
|
||||
|
||||
$flags = [];
|
||||
|
||||
/**
|
||||
* Bet365
|
||||
*/
|
||||
@@ -84,7 +86,7 @@ class Bet365
|
||||
$base['sport_id'] = $event->sport_id;
|
||||
$base['provider_id'] = Nuh::$options['provider_id'];
|
||||
$base['bmoid'] = $event->bet365_id;
|
||||
$base['flag'] = 1;
|
||||
$base['flags'] = 1;
|
||||
|
||||
/**
|
||||
* 1X2
|
||||
@@ -98,6 +100,8 @@ class Bet365
|
||||
|
||||
$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) {
|
||||
@@ -106,10 +110,7 @@ class Bet365
|
||||
$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();
|
||||
}
|
||||
@@ -127,6 +128,8 @@ class Bet365
|
||||
|
||||
$odds = array_merge($odds, $base);
|
||||
|
||||
$flags['odds_dc'][] = $event->id;
|
||||
|
||||
$res = OddsDc::where('event_id', $event->id)->where('bookmaker_id', $bookmaker_id)->first();
|
||||
|
||||
if (! $res) {
|
||||
@@ -135,10 +138,7 @@ class Bet365
|
||||
$res->dc1x = $odds['dc1x'];
|
||||
$res->dc12 = $odds['dc12'];
|
||||
$res->dcx2 = $odds['dcx2'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -159,6 +159,8 @@ class Bet365
|
||||
|
||||
$odds = array_merge($odds, $base);
|
||||
|
||||
$flags['odds_totals'][] = $event->id;
|
||||
|
||||
if ($offer['goals_over_under']['odds'][1]['name'] == '2.5') {
|
||||
$odds['total'] = 2.5;
|
||||
$res = OddsTotal::where('event_id', $event->id)
|
||||
@@ -171,11 +173,8 @@ class Bet365
|
||||
} else {
|
||||
$res->over = $odds['over'];
|
||||
$res->under = $odds['under'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->difference = abs(1 / $odds['over'] - 1 / $odds['under']);
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -193,6 +192,8 @@ class Bet365
|
||||
|
||||
$odds = array_merge($odds, $base);
|
||||
|
||||
$flags['odds_ggng'][] = $event->id;
|
||||
|
||||
$res = OddsGgng::where('event_id', $event->id)->where('bookmaker_id', $bookmaker_id)->first();
|
||||
|
||||
if (! $res) {
|
||||
@@ -200,10 +201,7 @@ class Bet365
|
||||
} else {
|
||||
$res->gg = $odds['gg'];
|
||||
$res->ng = $odds['ng'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -222,15 +220,14 @@ class Bet365
|
||||
|
||||
$odds = array_merge($odds, $base);
|
||||
|
||||
$flags['odds_dnb'][] = $event->id;
|
||||
|
||||
if (! $res) {
|
||||
OddsDnb::create($odds);
|
||||
} else {
|
||||
$res->dnb1 = $odds['dnb1'];
|
||||
$res->dnb2 = $odds['dnb2'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -248,6 +245,8 @@ class Bet365
|
||||
|
||||
$odds = array_merge($odds, $base);
|
||||
|
||||
$flags['odds_3ways_ht'][] = $event->id;
|
||||
|
||||
$res = Odds3wayHt::where('event_id', $event->id)->where('bookmaker_id', $bookmaker_id)->first();
|
||||
|
||||
if (! $res) {
|
||||
@@ -256,10 +255,7 @@ class Bet365
|
||||
$res->h3w = $odds['h3w'];
|
||||
$res->d3w = $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();
|
||||
}
|
||||
@@ -267,5 +263,9 @@ class Bet365
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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