remove lastcontrol timestamp
This commit is contained in:
1 parent
cc8ddb544b
commit
0742b6c19f
65 files changed
+122
-303
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,8 @@ class Logifuture
|
||||
|
||||
Authentication::authenticate();
|
||||
|
||||
$flags = [];
|
||||
|
||||
foreach ($sportmap as $logifuture_sport_id => $sport_id) {
|
||||
|
||||
$matches = LogifutureData::load($logifuture_sport_id);
|
||||
@@ -63,6 +65,8 @@ class Logifuture
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], ['in_feed' => 1, 'bmoid' => $event['event_id'], 'startime' => $event['starttime']]);
|
||||
|
||||
$flags[$sport_id][] = $event['id'];
|
||||
|
||||
switch ($sport_id) {
|
||||
case 1:
|
||||
Soccer::get($event, $match);
|
||||
@@ -91,5 +95,14 @@ class Logifuture
|
||||
if ($event_id_collector) {
|
||||
EventBookmaker::whereNotIn('event_id', $event_id_collector)->where('bookmaker_id', Nuh::$options['bookmaker_id'])->update(['in_feed' => 0]);
|
||||
}
|
||||
|
||||
$tables = [];
|
||||
$tables[1] = ['odds_3ways', 'odds_totals', 'odds_ggng', 'odds_dc', 'odds_tq'];
|
||||
$tables[2] = ['odds_2ways', 'odds_2ways_s1', 'odds_3ways', 'odds_totals', 'odds_points', 'odds_points_q1', 'odds_totals_q1'];
|
||||
$tables[3] = ['odds_totals', 'odds_points', 'odds_points_q1', 'odds_totals_q1'];
|
||||
$tables[5] = ['odds_2ways', 'odds_2ways_s1', 'odds_totals', 'odds_points'];
|
||||
foreach ($tables as $sport_id => $table) {
|
||||
DB::table($table)->where('bookmaker_id', $bookmaker_id)->whereNotIn('event_id', $flags[$sport_id])->update(['flags' => 0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,10 +99,7 @@ class Icehockey
|
||||
$res->h3w = number_format($_3way['h3w'], 2);
|
||||
$res->d3w = number_format($_3way['d3w'], 2);
|
||||
$res->a3w = number_format($_3way['a3w'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $_3way['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -122,10 +119,7 @@ class Icehockey
|
||||
} else {
|
||||
$res->h2w = number_format($ml['h2w'], 2);
|
||||
$res->a2w = number_format($ml['a2w'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $ml['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -144,10 +138,7 @@ class Icehockey
|
||||
} else {
|
||||
$res->h2w = number_format($ml['h2w'], 2);
|
||||
$res->a2w = number_format($ml['a2w'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $mls1['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -91,10 +91,7 @@ class Soccer
|
||||
$res->h3w = number_format($_3way['h3w'], 2);
|
||||
$res->d3w = number_format($_3way['d3w'], 2);
|
||||
$res->a3w = number_format($_3way['a3w'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $_3way['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -118,10 +115,7 @@ class Soccer
|
||||
} else {
|
||||
$res->over = number_format($_total['over'], 2);
|
||||
$res->under = number_format($_total['under'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $_total['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -140,10 +134,7 @@ class Soccer
|
||||
} else {
|
||||
$res->gg = number_format($_ggng['gg'], 2);
|
||||
$res->ng = number_format($_ggng['ng'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $_ggng['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -164,10 +155,7 @@ class Soccer
|
||||
$res->dc1x = number_format($_dc['dc1x'], 2);
|
||||
$res->dc12 = number_format($_dc['dc12'], 2);
|
||||
$res->dcx2 = number_format($_dc['dcx2'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $_dc['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -187,10 +175,7 @@ class Soccer
|
||||
} else {
|
||||
$res->htq = number_format($_tq['htq'], 2);
|
||||
$res->atq = number_format($_tq['atq'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $_tq['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -82,10 +82,7 @@ class Tennis
|
||||
} else {
|
||||
$res->h2w = number_format($ml['h2w'], 2);
|
||||
$res->a2w = number_format($ml['a2w'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $ml['margin'];
|
||||
$res->save();
|
||||
}
|
||||
@@ -104,10 +101,7 @@ class Tennis
|
||||
} else {
|
||||
$res->h2w = number_format($ml['h2w'], 2);
|
||||
$res->a2w = number_format($ml['a2w'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $mls1['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ class LogifutureStorePoints
|
||||
$odds['active_spread'] = $value['active_spread'];
|
||||
$odds['handicap'] = $handicap;
|
||||
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
|
||||
$odds['flags'] = 1;
|
||||
|
||||
$odds = array_merge($odds, $base);
|
||||
|
||||
@@ -34,12 +35,9 @@ class LogifutureStorePoints
|
||||
$res->home = number_format($odds['home'], 2);
|
||||
$res->away = number_format($odds['away'], 2);
|
||||
$res->handicap = number_format($odds['handicap'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->active_spread = $odds['active_spread'];
|
||||
$res->difference = $odds['difference'];
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class LogifutureStorePointsQ1
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
$odds['active_spread'] = $value['active_spread'];
|
||||
$odds['handicap'] = $handicap;
|
||||
$odds['flags'] = 1;
|
||||
$odds['difference'] = abs(1 / $odds['home'] - 1 / $odds['away']);
|
||||
|
||||
$odds = array_merge($odds, $base);
|
||||
@@ -34,12 +35,9 @@ class LogifutureStorePointsQ1
|
||||
$res->home = number_format($odds['home'], 2);
|
||||
$res->away = number_format($odds['away'], 2);
|
||||
$res->handicap = number_format($odds['handicap'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->active_spread = $odds['active_spread'];
|
||||
$res->difference = $odds['difference'];
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ class LogifutureStoreTotals
|
||||
$odds['under'] = $value['ele2'];
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
$odds['active_spread'] = $value['active_spread'];
|
||||
$odds['flags'] = 1;
|
||||
$odds['total'] = $total;
|
||||
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
|
||||
|
||||
@@ -34,12 +35,9 @@ class LogifutureStoreTotals
|
||||
$res->over = number_format($odds['over'], 2);
|
||||
$res->under = number_format($odds['under'], 2);
|
||||
$res->total = number_format($odds['total'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->active_spread = $odds['active_spread'];
|
||||
$res->difference = $odds['difference'];
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ class LogifutureStoreTotalsQ1
|
||||
$odds['under'] = $value['ele2'];
|
||||
$odds['margin'] = (float) Margin::calculate($odds, 1);
|
||||
$odds['active_spread'] = $value['active_spread'];
|
||||
$odds['flags'] = 1;
|
||||
$odds['total'] = $total;
|
||||
$odds['difference'] = abs(1 / $odds['over'] - 1 / $odds['under']);
|
||||
|
||||
@@ -34,12 +35,9 @@ class LogifutureStoreTotalsQ1
|
||||
$res->over = number_format($odds['over'], 2);
|
||||
$res->under = number_format($odds['under'], 2);
|
||||
$res->total = number_format($odds['total'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->active_spread = $odds['active_spread'];
|
||||
$res->difference = $odds['difference'];
|
||||
$res->checked_at = now();
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,6 @@ class Odds
|
||||
$base['provider_id'] = Nuh::$options['provider_id'];
|
||||
$base['bmoid'] = preg_replace('/\D/', '', $match['i']);
|
||||
$base['flag'] = 1;
|
||||
$base['checked_at'] = now();
|
||||
|
||||
$event_id_collector[] = $event_id;
|
||||
|
||||
@@ -148,5 +147,9 @@ class Odds
|
||||
->where('bookmaker_id', Nuh::$options['bookmaker_id'])
|
||||
->update(['in_feed' => 0]);
|
||||
|
||||
$tables = ['odds_3ways', 'odds_dc', 'odds_ggng', 'odds_points', 'odds_points_q1', 'odds_totals', 'odds_totals_q1', 'odds_tq'];
|
||||
foreach ($tables as $table) {
|
||||
DB::table($table)->where('bookmaker_id', $bookmaker_id)->whereNotIn('event_id', $event_id_collector)->update(['flags' => 0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,10 +25,6 @@ class MaglooStore1x2
|
||||
$res->a3w = $odds['d3w'];
|
||||
$res->d3w = $odds['a3w'];
|
||||
$res->flags = 1;
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -26,10 +26,6 @@ class MaglooStoreDc
|
||||
$res->dc12 = $odds['dc12'];
|
||||
$res->dcx2 = $odds['dcx2'];
|
||||
$res->flags = 1;
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -24,10 +24,6 @@ class MaglooStoreGgng
|
||||
$res->gg = $odds['gg'];
|
||||
$res->ng = $odds['ng'];
|
||||
$res->flags = 1;
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -33,12 +33,8 @@ class MaglooStorePoints
|
||||
$res->home = number_format($odds['home'], 2);
|
||||
$res->away = number_format($odds['away'], 2);
|
||||
$res->handicap = number_format($odds['handicap'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->active_spread = $odds['active_spread'];
|
||||
$res->difference = $odds['difference'];
|
||||
$res->checked_at = now();
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -33,12 +33,8 @@ class MaglooStorePointsQ1
|
||||
$res->home = number_format($odds['home'], 2);
|
||||
$res->away = number_format($odds['away'], 2);
|
||||
$res->handicap = number_format($odds['handicap'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->active_spread = $odds['active_spread'];
|
||||
$res->difference = $odds['difference'];
|
||||
$res->checked_at = now();
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -33,12 +33,8 @@ class MaglooStoreTotals
|
||||
$res->over = number_format($odds['over'], 2);
|
||||
$res->under = number_format($odds['under'], 2);
|
||||
$res->total = number_format($odds['total'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->active_spread = $odds['active_spread'];
|
||||
$res->difference = $odds['difference'];
|
||||
$res->checked_at = now();
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -33,12 +33,8 @@ class MaglooStoreTotalsQ1
|
||||
$res->over = number_format($odds['over'], 2);
|
||||
$res->under = number_format($odds['under'], 2);
|
||||
$res->total = number_format($odds['total'], 2);
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->active_spread = $odds['active_spread'];
|
||||
$res->difference = $odds['difference'];
|
||||
$res->checked_at = now();
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -24,10 +24,6 @@ class MaglooStoreTq
|
||||
$res->flags = 1;
|
||||
$res->htq = $odds['htq'];
|
||||
$res->atq = $odds['atq'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ class Odds
|
||||
$odds['bookmaker_id'] = $bookmaker_id;
|
||||
$odds['sport_id'] = $sport_id;
|
||||
$odds['provider_id'] = Nuh::$options['provider_id'];
|
||||
$odds['checked_at'] = now();
|
||||
$odds['flags'] = 1;
|
||||
|
||||
foreach ($book->offer as $offer) {
|
||||
|
||||
|
||||
@@ -22,10 +22,7 @@ class _2Way
|
||||
} else {
|
||||
$res->h2w = $odds['h2w'];
|
||||
$res->a2w = $odds['a2w'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -22,10 +22,7 @@ class _2WayS1
|
||||
} else {
|
||||
$res->h2w = $odds['h2w'];
|
||||
$res->a2w = $odds['a2w'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -24,10 +24,7 @@ class _3Way
|
||||
$res->h3w = $odds['h3w'];
|
||||
$res->a3w = $odds['d3w'];
|
||||
$res->d3w = $odds['a3w'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -24,10 +24,7 @@ class _3WayHt
|
||||
$res->h3w = $odds['h3w'];
|
||||
$res->d3w = $odds['d3w'];
|
||||
$res->d3w = $odds['a3w'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -24,10 +24,7 @@ class _Dc
|
||||
$res->dc1x = $odds['dc1x'];
|
||||
$res->dc12 = $odds['dc12'];
|
||||
$res->dcx2 = $odds['dcx2'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -22,10 +22,7 @@ class _Dnb
|
||||
} else {
|
||||
$res->dnb1 = $odds['dnb1'];
|
||||
$res->dnb2 = $odds['dnb2'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -22,10 +22,7 @@ class _Ggng
|
||||
} else {
|
||||
$res->gg = $odds['gg'];
|
||||
$res->ng = $odds['ng'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -34,10 +34,7 @@ class _Points
|
||||
} else {
|
||||
$res->home = $odds['home'];
|
||||
$res->away = $odds['away'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -34,10 +34,7 @@ class _PointsHt
|
||||
} else {
|
||||
$res->home = $odds['home'];
|
||||
$res->away = $odds['away'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -34,10 +34,7 @@ class _PointsQ1
|
||||
} else {
|
||||
$res->home = $odds['home'];
|
||||
$res->away = $odds['away'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -40,10 +40,7 @@ class _Totals
|
||||
} else {
|
||||
$res->over = $odds['over'];
|
||||
$res->under = $odds['under'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -40,10 +40,7 @@ class _TotalsHt
|
||||
} else {
|
||||
$res->over = $odds['over'];
|
||||
$res->under = $odds['under'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -40,10 +40,7 @@ class _TotalsQ1
|
||||
} else {
|
||||
$res->over = $odds['over'];
|
||||
$res->under = $odds['under'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -22,10 +22,7 @@ class _Tq
|
||||
} else {
|
||||
$res->htq = $odds['htq'];
|
||||
$res->atq = $odds['atq'];
|
||||
if ($res->isDirty()) {
|
||||
$res->oddchange_at = now();
|
||||
}
|
||||
$res->checked_at = $odds['checked_at'];
|
||||
$res->flags = 1;
|
||||
$res->margin = $odds['margin'];
|
||||
$res->save();
|
||||
}
|
||||
|
||||
@@ -18,8 +18,22 @@ class AlarmStore
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* get favorit
|
||||
*/
|
||||
$favorit = 100;
|
||||
foreach ($oddnames as $fieldname => $oddname) {
|
||||
if ($client_odds[$oddname] < $favorit) {
|
||||
$favorit = $oddname;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* evaluate
|
||||
*/
|
||||
$update_array = [];
|
||||
foreach ($oddnames as $fieldname => $oddname) {
|
||||
if ($oddname == $favorit) {
|
||||
|
||||
$threshold = $client_odds[$oddname] - $compare_odds[$oddname];
|
||||
|
||||
if ($threshold > $alarm_threshold[3]) {
|
||||
@@ -32,7 +46,10 @@ class AlarmStore
|
||||
// GRÜNE
|
||||
$update_array[$fieldname] = 1;
|
||||
} else {
|
||||
// Rset Alarm
|
||||
// Reset Alarm
|
||||
$update_array[$fieldname] = 0;
|
||||
}
|
||||
} else {
|
||||
$update_array[$fieldname] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
class FilterOdds
|
||||
{
|
||||
public static function filter(&$bookmakers)
|
||||
{
|
||||
if (auth()->user()->is_multiline_direct) {
|
||||
/**
|
||||
* ORDER
|
||||
*/
|
||||
$order = $bookmakers['bookmaker'] ?? [];
|
||||
|
||||
ColumnOdds::$data->sortBy(function ($model) use ($order) {
|
||||
return array_search($model->bookmaker_id, $order);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* SET SLOT
|
||||
*/
|
||||
// $filter = $bookmakers['filter'] ?? [];
|
||||
|
||||
// if ($filter) {
|
||||
// $data = $data->filter(function ($model) use ($filter) {
|
||||
|
||||
// if ($model->bookmaker_id == auth()->user()->bookmaker_id) {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// $filter = $filter[$model->bookmaker_id] ?? 0;
|
||||
|
||||
// $checked_at = Carbon::createFromDate($model->checked_at)->timestamp;
|
||||
|
||||
// if (! isset($filter['margin'])) {
|
||||
// Bookmakers::updateOrCreate(['id' => (int) $model->bookmaker_id], ['need_check' => 1]);
|
||||
// }
|
||||
|
||||
// if ($model->margin <= $filter['margin'] && $checked_at > time() - $filter['time_lastcheck']) {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// return false;
|
||||
// });
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ namespace App\Filament\Tables\Columns;
|
||||
|
||||
use App\Utilities\BkmIconMap;
|
||||
use Filament\Tables\Columns\Column;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class TooltipOdds extends Column
|
||||
{
|
||||
@@ -149,7 +148,7 @@ class TooltipOdds extends Column
|
||||
$this->pop .= $this->getOdd($value[$oddname], $oddname);
|
||||
}
|
||||
$this->pop .= $this->getMargin($value->margin);
|
||||
$this->pop .= $this->getCheck($value->checked_at);
|
||||
$this->pop .= $this->getFlags($value->flags);
|
||||
if ($k % 2 == 0 && $this->size > $this->two_cols_break) {
|
||||
$this->pop .= '<div></div>';
|
||||
}
|
||||
@@ -182,21 +181,13 @@ class TooltipOdds extends Column
|
||||
$this->pop .= $str.number_format($odd, 1).'</div>';
|
||||
}
|
||||
|
||||
public function getCheck($lastcheck)
|
||||
public function getFlags($flags)
|
||||
{
|
||||
$lastcheck_5min = Carbon::createFromDate($lastcheck)->addMinutes(5);
|
||||
$lastcheck_30min = Carbon::createFromDate($lastcheck)->addMinutes(30);
|
||||
$now = Carbon::now();
|
||||
|
||||
if ($lastcheck_30min->lt($now)) {
|
||||
$this->pop .= '<div class="text-xs text-nowrap bg-red-600/20 rounded shadow">';
|
||||
} elseif ($lastcheck_5min->lt($now)) {
|
||||
$this->pop .= '<div class="text-xs text-nowrap bg-blue-600/20 rounded">';
|
||||
if ($flags) {
|
||||
$this->pop .= '<div></div>';
|
||||
} else {
|
||||
$this->pop .= '<div class="text-xs text-nowrap">';
|
||||
$this->pop .= '<div><x-filament::icon-button icon="heroicon-m-exclamation-triangle" color="info" /></div>';
|
||||
}
|
||||
|
||||
$this->pop .= Carbon::createFromDate($lastcheck)->format('H:i').'</div>';
|
||||
}
|
||||
|
||||
public function makeHeader()
|
||||
|
||||
@@ -26,8 +26,6 @@ class Odds2way extends Model
|
||||
'margin',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -26,8 +26,6 @@ class Odds2wayS1 extends Model
|
||||
'margin',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -28,8 +28,6 @@ class Odds3way extends Model
|
||||
'margin',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function comparing_bookmaker()
|
||||
|
||||
@@ -28,8 +28,6 @@ class Odds3wayHt extends Model
|
||||
'margin',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function event()
|
||||
|
||||
@@ -28,8 +28,6 @@ class OddsDc extends Model
|
||||
'margin',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -26,8 +26,6 @@ class OddsDnb extends Model
|
||||
'margin',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -26,8 +26,6 @@ class OddsGgng extends Model
|
||||
'margin',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -29,8 +29,6 @@ class OddsPoint extends Model
|
||||
'active_spread',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -29,8 +29,6 @@ class OddsPointHt extends Model
|
||||
'active_spread',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -29,8 +29,6 @@ class OddsPointQ1 extends Model
|
||||
'active_spread',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -29,8 +29,6 @@ class OddsTotal extends Model
|
||||
'active_spread',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -29,8 +29,6 @@ class OddsTotalHt extends Model
|
||||
'active_spread',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -29,8 +29,6 @@ class OddsTotalQ1 extends Model
|
||||
'margin',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -26,8 +26,6 @@ class OddsTq extends Model
|
||||
'margin',
|
||||
'flags',
|
||||
'nuh_check',
|
||||
'checked_at',
|
||||
'oddchange_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
|
||||
@@ -25,8 +25,7 @@ return new class extends Migration
|
||||
$table->decimal('margin', 5, 1)->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@ return new class extends Migration
|
||||
$table->decimal('margin', 5, 1)->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ return new class extends Migration
|
||||
$table->decimal('margin', 5, 1)->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ return new class extends Migration
|
||||
$table->decimal('margin', 5, 1)->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ return new class extends Migration
|
||||
$table->decimal('margin', 5, 1)->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ return new class extends Migration
|
||||
$table->decimal('margin', 5, 1)->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ return new class extends Migration
|
||||
$table->decimal('margin', 5, 1)->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ return new class extends Migration
|
||||
$table->decimal('margin', 5, 1)->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ return new class extends Migration
|
||||
$table->boolean('active_spread')->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ return new class extends Migration
|
||||
$table->boolean('active_spread')->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ return new class extends Migration
|
||||
$table->boolean('active_spread')->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ return new class extends Migration
|
||||
$table->boolean('active_spread')->default(0);
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ return new class extends Migration
|
||||
$table->boolean('flags')->default(0);
|
||||
$table->boolean('active_spread')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ return new class extends Migration
|
||||
$table->decimal('difference', 5, 4)->default(0);
|
||||
$table->boolean('active_spread')->default(0);
|
||||
$table->boolean('nuh_check')->default(0);
|
||||
$table->timestamp('oddchange_at');
|
||||
$table->timestamp('checked_at');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user