comparing bookmaker wip
This commit is contained in:
1 parent
de95867692
commit
be80128226
11 files changed
+237
-93
No files matched your search
@@ -79,7 +79,7 @@ class GenerateDefaultSetting
|
||||
Notice::note('3) comparing bookmaker', 'p');
|
||||
}
|
||||
|
||||
$bookmakers = Bookmaker::where('is_active', 1)->pluck('id')->toArray();
|
||||
$bookmakers = Bookmaker::get();
|
||||
|
||||
$res = Client::get();
|
||||
foreach ($res as $client) {
|
||||
@@ -98,19 +98,32 @@ class GenerateDefaultSetting
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($bookmakers as $sorting => $bookmaker_id) {
|
||||
$i = 0;
|
||||
foreach ($bookmakers as $bookmaker) {
|
||||
|
||||
$is_hidden = \in_array($bookmaker_id, $in_table_bookmaker) ? 0 : 1;
|
||||
$i++;
|
||||
|
||||
$is_hidden = \in_array($bookmaker->id, $in_table_bookmaker) ? 0 : 1;
|
||||
|
||||
foreach ($client_bookmakers as $client_bookmaker_id) {
|
||||
|
||||
if ($client_bookmaker_id != $bookmaker_id) {
|
||||
if ($client_bookmaker_id != $bookmaker->id) {
|
||||
|
||||
for ($method_id = 1; $method_id <= 4; $method_id++) {
|
||||
ComparingBookmaker::updateOrCreate(
|
||||
['method_id' => $method_id, 'sport_id' => $sport_id, 'client_bookmaker_id' => $client_bookmaker_id, 'bookmaker_id' => $bookmaker_id],
|
||||
['is_hidden' => $is_hidden, 'is_active' => 1, 'sorting' => $sorting]
|
||||
);
|
||||
if ($bookmaker->is_active) {
|
||||
for ($method_id = 1; $method_id <= 4; $method_id++) {
|
||||
ComparingBookmaker::updateOrCreate(
|
||||
['method_id' => $method_id, 'sport_id' => $sport_id, 'client_bookmaker_id' => $client_bookmaker_id, 'bookmaker_id' => $bookmaker->id],
|
||||
['is_hidden' => $is_hidden, 'is_active' => 1, 'time_lastcheck' => 600, 'margin_threshold' => 110, 'sorting' => $i]
|
||||
);
|
||||
}
|
||||
} else {
|
||||
for ($method_id = 1; $method_id <= 4; $method_id++) {
|
||||
ComparingBookmaker::where('method_id', $method_id)
|
||||
->where('sport_id', $sport_id)
|
||||
->where('bookmaker_id', $bookmaker->id)
|
||||
->where('client_bookmaker_id', $client_bookmaker_id)
|
||||
->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user