add more bettypes to comp with dds for sports

This commit is contained in:
salam committed 2026-01-09 08:00:43 +01:00
1 parent 61418c8cee
commit 1aa044fff1
14 files changed
+69 -56

No files matched your search

+12 -9
View File
@@ -2,26 +2,29 @@
namespace App\Actions;
use App\Models\BettypeUser;
use App\Models\MultilineSetting;
use DB;
use Filament\Notifications\Notification;
class BettypUserGenerator
{
public static function run($record)
{
$user_id = $record->id;
$user_id = (int) $record->id;
$multilines = MultilineSetting::select('id', 'sport_id')->get();
$multilines = MultilineSetting::orderBy('sport_id')->pluck('sport_id', 'id');
foreach ($multilines as $multiline) {
foreach ($multilines as $multiline_setting_id => $sport_id) {
$is_active = in_array($multiline->id, [1, 6, 7, 10, 8, 12, 15, 16, 17]) ? 1 : 0;
$is_active = in_array($multiline_setting_id, [1, 2, 9, 10, 16, 17, 22, 23]) ? 1 : 0;
$setting = [];
$setting['sport_id'] = $sport_id;
$setting['user_id'] = $user_id;
$setting['multiline_setting_id'] = $multiline_setting_id;
DB::table('bettype_users')->updateOrInsert($setting, ['is_active' => $is_active]);
BettypeUser::updateOrCreate(
['user_id' => (int) $user_id, 'multiline_setting_id' => (int) $multiline->id, 'sport_id' => (int) $multiline->sport_id],
['is_active' => (int) $is_active]
);
}
Notification::make()
+14 -15
View File
@@ -4,6 +4,7 @@ namespace App\Actions;
use App\Models\MultilineClient;
use App\Models\MultilineSetting;
use DB;
use Filament\Notifications\Notification;
class MultilineGenerator
@@ -16,27 +17,25 @@ class MultilineGenerator
$bookmaker = [0, 6, 30, 649, 117];
foreach ($record->sport as $sportid) {
foreach ($record->sport as $sport_id) {
$multilines = MultilineSetting::where('sport_id', $sportid)->get();
$multilines = MultilineSetting::where('sport_id', $sport_id)->get();
foreach ($multilines as $multiline) {
for ($i = 1; $i <= 4; $i++) {
MultilineClient::updateOrCreate(
[
'client_id' => $client_id,
'sport_id' => $sportid,
'multiline_setting_id' => $multiline->id,
'position' => $i,
],
[
'bookmaker_id' => $bookmaker[$i],
'sort' => $i,
'disabled' => 0,
]
);
$setting = [];
$setting['client_id'] = $client_id;
$setting['sport_id'] = $sport_id;
$setting['multiline_setting_id'] = $multiline->id;
$setting['position'] = $i;
DB::table('multiline_clients')->updateOrInsert($setting, [
'bookmaker_id' => $bookmaker[$i],
'sort' => $i,
'disabled' => 0,
]);
}
}
+1 -1
View File
@@ -131,9 +131,9 @@ class Odds
case 5:
/**
* 1 2-WAY
* 131073 MONEY LINE - Q1
* 3 POINTS
* 4 TOTALS
* 131073 MONEY LINE - Q1
*/
$markets = '1,3,4,131073';
break;
+1
View File
@@ -13,6 +13,7 @@ class BettypeUser extends Model
'sport_id',
'multiline_setting_id',
'is_active',
'unique_key',
];
protected static function booted(): void
+1 -1
View File
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class Odds3wayHt extends Model
{
protected $table = 'odds_3ways';
protected $table = 'odds_3ways_ht';
protected $fillable = [
'id',
+1 -1
View File
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class OddsPointHt extends Model
{
protected $table = 'odds_points';
protected $table = 'odds_points_ht';
protected $fillable = [
'id',
File renamed without changes.
+1 -1
View File
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class OddsTotalHt extends Model
{
protected $table = 'odds_totals';
protected $table = 'odds_totals_ht';
protected $fillable = [
'id',
@@ -11,7 +11,7 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('odds3way_hts', function (Blueprint $table) {
Schema::create('odds_3ways_ht', function (Blueprint $table) {
$table->id();
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
$table->integer('sport_id')->index()->references('id')->on('sports');
@@ -34,6 +34,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('odds3way_hts');
Schema::dropIfExists('odds_3ways_ht');
}
};
@@ -36,6 +36,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('odds_q1_points');
Schema::dropIfExists('odds_points_q1');
}
};
@@ -11,7 +11,7 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('odds_point_ht', function (Blueprint $table) {
Schema::create('odds_points_ht', function (Blueprint $table) {
$table->id();
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
$table->integer('sport_id')->index()->references('id')->on('sports');
@@ -35,6 +35,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('odds_point_ht');
Schema::dropIfExists('odds_points_ht');
}
};
@@ -11,7 +11,7 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('odds_total_hts', function (Blueprint $table) {
Schema::create('odds_totals_ht', function (Blueprint $table) {
$table->id();
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
$table->integer('sport_id')->index()->references('id')->on('sports');
@@ -35,6 +35,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('odds_total_hts');
Schema::dropIfExists('odds_totals_ht');
}
};
@@ -13,9 +13,9 @@ return new class extends Migration
{
Schema::create('bettype_users', function (Blueprint $table) {
$table->id();
$table->integer('user_id');
$table->integer('user_id')->index();
$table->integer('sport_id')->index()->references('id')->on('sports');
$table->integer('multiline_setting_id');
$table->integer('multiline_setting_id')->index();
$table->boolean('is_active')->default(false);
$table->timestamps();
});
+29 -19
View File
@@ -12,26 +12,36 @@ class MultilineSettingSeeder extends Seeder
/**
* Clients
*/
$sql = "INSERT INTO `multiline_settings` (`id`, `sport_id`, `name`, `short`, `table`, `rows`, `has_3_columns`, `created_at`, `updated_at`)
$sql = "INSERT INTO `multiline_settings` (`sport_id`, `name`, `short`, `table`, `rows`, `has_3_columns`, `created_at`, `updated_at`)
VALUES
(1, 1, '1X2', '1X2', 'odds_3ways', 4, 1, '2025-12-14 09:25:48', '2025-12-14 09:25:48'),
(2, 1, 'DOUBLE CHANCE', 'DC', 'odds_dc', 4, 1, '2025-12-14 09:31:22', '2025-12-14 09:32:55'),
(3, 1, 'DRAW NO BET', 'DNB', 'odds_dnb', 4, 0, '2025-12-14 09:31:42', '2025-12-14 09:31:42'),
(4, 1, 'GOAL NO GOAL', 'GGNG', 'odds_ggng', 4, 0, '2025-12-14 09:31:56', '2025-12-14 09:31:56'),
(5, 1, 'TO QUALIFY', 'TQ', 'odds_tq', 4, 0, '2025-12-14 09:32:19', '2025-12-14 09:32:19'),
(6, 1, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:32:38', '2025-12-14 09:32:38'),
(7, 3, 'MONEY LINE', 'ML', 'odds_2ways', 4, 0, '2025-12-14 09:37:32', '2025-12-14 09:37:32'),
(8, 3, 'HANDICAP', 'HC', 'odds_points', 4, 1, '2025-12-14 09:38:05', '2025-12-14 09:38:05'),
(9, 3, 'HANDICAP FIRST QUARTER', 'HCQ1', 'odds_points_q1', 4, 1, '2025-12-14 09:38:26', '2025-12-14 09:39:54'),
(10, 3, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:38:44', '2025-12-14 09:38:44'),
(11, 3, 'TOTALS FIRST QUARTER', 'OUQ1', 'odds_totals_q1', 4, 1, '2025-12-14 09:39:12', '2025-12-14 09:39:59'),
(12, 2, 'MONEY LINE', 'ML', 'odds_2ways', 4, 0, '2025-12-14 09:41:21', '2025-12-14 09:41:21'),
(13, 2, '1X2', '1X2', 'odds_3ways', 4, 1, '2025-12-14 09:41:34', '2025-12-14 09:41:34'),
(14, 2, 'HANDICAP', 'HC', 'odds_points', 4, 1, '2025-12-14 09:41:56', '2025-12-14 09:41:56'),
(15, 2, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:42:13', '2025-12-14 09:42:13'),
(16, 5, 'MONEY LINE', 'ML', 'odds_2ways', 4, 0, '2025-12-14 09:43:52', '2025-12-14 09:43:52'),
(17, 5, 'MONEY LINE SET 1', 'MLS1', 'odds_2ways_s1', 4, 0, '2025-12-14 09:44:13', '2025-12-14 09:44:13'),
(18, 5, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:44:26', '2025-12-14 09:44:26');
(1, '1X2', '1X2', 'odds_3ways', 4, 1, '2025-12-14 09:25:48', '2025-12-14 09:25:48'),
(1, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:32:38', '2025-12-14 09:32:38'),
(1, '1X2 HALF TIME', '1X2 HT', 'odds_3ways_ht', 4, 1, '2025-12-14 09:25:48', '2025-12-14 09:25:48'),
(1, 'TOTALS HALF TIME', 'OU HT', 'odds_totals_ht', 4, 1, '2025-12-14 09:32:38', '2025-12-14 09:32:38'),
(1, 'GOAL NO GOAL', 'GGNG', 'odds_ggng', 4, 0, '2025-12-14 09:31:56', '2025-12-14 09:31:56'),
(1, 'DOUBLE CHANCE', 'DC', 'odds_dc', 4, 1, '2025-12-14 09:31:22', '2025-12-14 09:32:55'),
(1, 'TO QUALIFY', 'TQ', 'odds_tq', 4, 0, '2025-12-14 09:32:19', '2025-12-14 09:32:19'),
(1, 'DRAW NO BET', 'DNB', 'odds_dnb', 4, 0, '2025-12-14 09:31:42', '2025-12-14 09:31:42'),
(2, '1X2', '1X2', 'odds_3ways', 4, 1, '2025-12-14 09:41:34', '2025-12-14 09:41:34'),
(2, 'MONEY LINE', 'ML', 'odds_2ways', 4, 0, '2025-12-14 09:41:21', '2025-12-14 09:41:21'),
(2, 'POINTS', 'HC', 'odds_points', 4, 1, '2025-12-14 09:41:56', '2025-12-14 09:41:56'),
(2, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:42:13', '2025-12-14 09:42:13'),
(2, 'POINTS FIRST QUARTER', 'HC Q1', 'odds_points_q1', 4, 1, '2025-12-14 09:41:56', '2025-12-14 09:41:56'),
(2, 'TOTALS FIRST QUARTER', 'OU Q1', 'odds_totals_q1', 4, 1, '2025-12-14 09:42:13', '2025-12-14 09:42:13'),
(3, 'MONEY LINE', 'ML', 'odds_2ways', 4, 0, '2025-12-14 09:37:32', '2025-12-14 09:37:32'),
(3, 'POINTS', 'HC', 'odds_points', 4, 1, '2025-12-14 09:38:05', '2025-12-14 09:38:05'),
(3, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:38:44', '2025-12-14 09:38:44'),
(3, 'POINTS FIRST QUARTER', 'HC Q1', 'odds_points_q1', 4, 1, '2025-12-14 09:38:26', '2025-12-14 09:39:54'),
(3, 'TOTALS FIRST QUARTER', 'OU Q1', 'odds_totals_q1', 4, 1, '2025-12-14 09:39:12', '2025-12-14 09:39:59'),
(3, 'POINTS HALF TIME', 'HC HT', 'odds_points_ht', 4, 1, '2025-12-14 09:38:26', '2025-12-14 09:39:54'),
(3, 'TOTALS HALF TIME', 'OU HT', 'odds_totals_ht', 4, 1, '2025-12-14 09:39:12', '2025-12-14 09:39:59'),
(5, 'MONEY LINE', 'ML', 'odds_2ways', 4, 0, '2025-12-14 09:43:52', '2025-12-14 09:43:52'),
(5, 'MONEY LINE SET 1', 'ML S1', 'odds_2ways_s1', 4, 0, '2025-12-14 09:44:13', '2025-12-14 09:44:13'),
(5, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:44:26', '2025-12-14 09:44:26'),
(5, 'POINTS', 'HC', 'odds_points', 4, 1, '2025-12-14 09:44:26', '2025-12-14 09:44:26');
";
DB::unprepared($sql);