wip
This commit is contained in:
1 parent
9ca5657827
commit
6f3d608704
47 files changed
+1005
-145
No files matched your search
@@ -3,6 +3,7 @@
|
||||
namespace App\Console\Commands\Services\Tasks;
|
||||
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\AlarmSetting;
|
||||
use App\Models\BettypeUser;
|
||||
use App\Models\Bookmaker;
|
||||
use App\Models\Client;
|
||||
@@ -24,11 +25,45 @@ class GenerateDefaultSetting
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* MULTILINE SLOTS
|
||||
* 1) ALARM BOOKMAKER
|
||||
**************************************************/
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('1) MULTILINE SLOTS', 'p');
|
||||
Notice::note('1) ALARM BOOKMAKER', 'p');
|
||||
}
|
||||
|
||||
$alarm_thresholds = [1 => 0.01, 2 => 0.2, 3 => 0.3];
|
||||
|
||||
$clients = Client::get();
|
||||
|
||||
foreach ($clients as $client) {
|
||||
|
||||
foreach ($client->sport as $sport_id) {
|
||||
|
||||
foreach ($client->bookmaker as $client_bookmaker_id) {
|
||||
|
||||
$multilines = MultilineSetting::where('sport_id', $sport_id)->get()->pluck('id');
|
||||
|
||||
foreach ($multilines as $multiline_id) {
|
||||
|
||||
foreach ($alarm_thresholds as $level_id => $alarm_threshold) {
|
||||
|
||||
AlarmSetting::firstOrCreate(
|
||||
['client_bookmaker_id' => $client_bookmaker_id, 'sport_id' => $sport_id, 'multiline_setting_id' => $multiline_id, 'level_id' => $level_id],
|
||||
['name' => "LEVEL $level_id", 'alarm_threshold' => $alarm_threshold]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* 2) MULTILINE SLOTS
|
||||
**************************************************/
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('2) MULTILINE SLOTS', 'p');
|
||||
}
|
||||
|
||||
$bookmaker_slots = [1 => 6, 2 => 30, 3 => 649, 4 => 126];
|
||||
@@ -58,11 +93,11 @@ class GenerateDefaultSetting
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* BETTYPES for USER in MONITOR
|
||||
* 3) BETTYPES for USER in MONITOR
|
||||
**************************************************/
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('2) GENERATOR BETTYPES IM COMPARATORE FOR USERS', 'p');
|
||||
Notice::note('3) GENERATOR BETTYPES IM COMPARATORE FOR USERS', 'p');
|
||||
}
|
||||
|
||||
$users = User::get();
|
||||
@@ -83,11 +118,11 @@ class GenerateDefaultSetting
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
* COMPARING BOOKMAKER
|
||||
* 4) COMPARING BOOKMAKER
|
||||
**************************************************/
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('3) COMPARING BOOKMAKER', 'p');
|
||||
Notice::note('4) COMPARING BOOKMAKER', 'p');
|
||||
}
|
||||
|
||||
$res = Client::get();
|
||||
@@ -104,13 +139,12 @@ class GenerateDefaultSetting
|
||||
|
||||
$i = 1;
|
||||
foreach ($bookmakers_soccer as $bookmaker_id) {
|
||||
|
||||
$margin_threshold = $bookmaker_id == 110 ? 103 : 115;
|
||||
ComparingBookmaker::updateOrCreate(
|
||||
['method_id' => 1, 'sport_id' => 1, 'client_bookmaker_id' => $client_bookmaker_id, 'bookmaker_id' => $bookmaker_id],
|
||||
['is_active' => 1, 'time_lastcheck' => 600, 'margin_threshold' => 110, 'sorting' => $i]
|
||||
['is_active' => 1, 'time_lastcheck' => 600, 'margin_threshold' => $margin_threshold, 'sorting' => $i]
|
||||
);
|
||||
$i++;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user