save updates

This commit is contained in:
salam committed 2026-02-07 07:08:58 +01:00
1 parent 3671902fe7
commit 046407df18
36 files changed
+261 -305

No files matched your search

+19 -15
View File
@@ -27,6 +27,7 @@ use App\Models\EventBookmaker;
use App\Models\Group;
use App\Models\Supervisor;
use App\Models\TxoddsMarket;
use App\Utilities\DatabaseFunctions;
use App\Utilities\Notice;
use Illuminate\Support\Carbon;
@@ -316,12 +317,13 @@ class Odds
case 0:
foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
switch ($attributeName) {
case 'starting_time':
EventBookmaker::updateOrInsert([
'event_id' => $event_id,
'sport_id' => $sport_id,
'bookmaker_id' => $bookmaker_id,
], ['starttime' => $attributeValue]);
$res = EventBookmaker::where('event_id', $event_id)->where('bookmaker_id', $bookmaker_id)->first();
if ($res->starttime != $attributeValue) {
$res->starttime = $attributeValue;
DatabaseFunctions::save_update($res);
}
break;
}
}
@@ -332,11 +334,12 @@ class Odds
foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
switch ($attributeName) {
case 'starting_time':
EventBookmaker::updateOrInsert([
'event_id' => $event_id,
'sport_id' => $sport_id,
'bookmaker_id' => $bookmaker_id,
], ['starttime' => $attributeValue]);
$res = EventBookmaker::where('event_id', $event_id)->where('bookmaker_id', $bookmaker_id)->first();
if ($res->starttime != $attributeValue) {
$res->starttime = $attributeValue;
DatabaseFunctions::save_update($res);
}
break;
}
}
@@ -347,11 +350,12 @@ class Odds
foreach ($offer->odds->attributes() as $attributeName => $attributeValue) {
switch ($attributeName) {
case 'starting_time':
EventBookmaker::updateOrInsert([
'event_id' => $event_id,
'sport_id' => $sport_id,
'bookmaker_id' => $bookmaker_id,
], ['starttime' => $attributeValue]);
$res = EventBookmaker::where('event_id', $event_id)->where('bookmaker_id', $bookmaker_id)->first();
if ($res->starttime != $attributeValue) {
$res->starttime = $attributeValue;
DatabaseFunctions::save_update($res);
}
break;
}
}