From 10429f05959262379f405f4c41ee9a3d482d5bd9 Mon Sep 17 00:00:00 2001 From: salam Date: Mon, 16 Feb 2026 10:54:14 +0100 Subject: [PATCH] wip db --- .../TxOdds/Odds/Tools/ActiveSpread.php | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/Tools/ActiveSpread.php b/app/Console/Commands/Grapper/TxOdds/Odds/Tools/ActiveSpread.php index 577beb0e..5fc6d400 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/Tools/ActiveSpread.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/Tools/ActiveSpread.php @@ -40,17 +40,25 @@ class ActiveSpread DB::table($table)->where('event_id', $event_id)->where('bookmaker_id', $bookmaker_id)->update(['active_spread' => 0]); if (in_array($table, ['odds_points', 'odds_points_ht', 'odds_points_q1'])) { - DB::table($table) - ->where('event_id', $event_id) - ->where('bookmaker_id', $bookmaker_id) - ->where('handicap', (float) $value['active_spread']) - ->update(['active_spread' => 1]); + + DB::transaction(function () use ($table, $event_id, $bookmaker_id, $value) { + DB::table($table) + ->where('event_id', $event_id) + ->where('bookmaker_id', $bookmaker_id) + ->where('handicap', (float) $value['active_spread']) + ->update(['active_spread' => 1]); + }, 5); + } else { - DB::table($table) - ->where('event_id', $event_id) - ->where('bookmaker_id', $bookmaker_id) - ->where('total', (float) $value['active_spread']) - ->update(['active_spread' => 1]); + + DB::transaction(function () use ($table, $event_id, $bookmaker_id, $value) { + DB::table($table) + ->where('event_id', $event_id) + ->where('bookmaker_id', $bookmaker_id) + ->where('total', (float) $value['active_spread']) + ->update(['active_spread' => 1]); + }, 5); + } } }