add more bettypes to comp with dds for sports
This commit is contained in:
1 parent
61418c8cee
commit
1aa044fff1
14 files changed
+69
-56
No files matched your search
@@ -2,26 +2,29 @@
|
|||||||
|
|
||||||
namespace App\Actions;
|
namespace App\Actions;
|
||||||
|
|
||||||
use App\Models\BettypeUser;
|
|
||||||
use App\Models\MultilineSetting;
|
use App\Models\MultilineSetting;
|
||||||
|
use DB;
|
||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
|
|
||||||
class BettypUserGenerator
|
class BettypUserGenerator
|
||||||
{
|
{
|
||||||
public static function run($record)
|
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()
|
Notification::make()
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Actions;
|
|||||||
|
|
||||||
use App\Models\MultilineClient;
|
use App\Models\MultilineClient;
|
||||||
use App\Models\MultilineSetting;
|
use App\Models\MultilineSetting;
|
||||||
|
use DB;
|
||||||
use Filament\Notifications\Notification;
|
use Filament\Notifications\Notification;
|
||||||
|
|
||||||
class MultilineGenerator
|
class MultilineGenerator
|
||||||
@@ -16,27 +17,25 @@ class MultilineGenerator
|
|||||||
|
|
||||||
$bookmaker = [0, 6, 30, 649, 117];
|
$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) {
|
foreach ($multilines as $multiline) {
|
||||||
|
|
||||||
for ($i = 1; $i <= 4; $i++) {
|
for ($i = 1; $i <= 4; $i++) {
|
||||||
|
|
||||||
MultilineClient::updateOrCreate(
|
$setting = [];
|
||||||
[
|
$setting['client_id'] = $client_id;
|
||||||
'client_id' => $client_id,
|
$setting['sport_id'] = $sport_id;
|
||||||
'sport_id' => $sportid,
|
$setting['multiline_setting_id'] = $multiline->id;
|
||||||
'multiline_setting_id' => $multiline->id,
|
$setting['position'] = $i;
|
||||||
'position' => $i,
|
|
||||||
],
|
DB::table('multiline_clients')->updateOrInsert($setting, [
|
||||||
[
|
'bookmaker_id' => $bookmaker[$i],
|
||||||
'bookmaker_id' => $bookmaker[$i],
|
'sort' => $i,
|
||||||
'sort' => $i,
|
'disabled' => 0,
|
||||||
'disabled' => 0,
|
]);
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,9 +131,9 @@ class Odds
|
|||||||
case 5:
|
case 5:
|
||||||
/**
|
/**
|
||||||
* 1 2-WAY
|
* 1 2-WAY
|
||||||
|
* 131073 MONEY LINE - Q1
|
||||||
* 3 POINTS
|
* 3 POINTS
|
||||||
* 4 TOTALS
|
* 4 TOTALS
|
||||||
* 131073 MONEY LINE - Q1
|
|
||||||
*/
|
*/
|
||||||
$markets = '1,3,4,131073';
|
$markets = '1,3,4,131073';
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class BettypeUser extends Model
|
|||||||
'sport_id',
|
'sport_id',
|
||||||
'multiline_setting_id',
|
'multiline_setting_id',
|
||||||
'is_active',
|
'is_active',
|
||||||
|
'unique_key',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected static function booted(): void
|
protected static function booted(): void
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class Odds3wayHt extends Model
|
class Odds3wayHt extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'odds_3ways';
|
protected $table = 'odds_3ways_ht';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'id',
|
'id',
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class OddsPointHt extends Model
|
class OddsPointHt extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'odds_points';
|
protected $table = 'odds_points_ht';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'id',
|
'id',
|
||||||
|
|||||||
File renamed without changes.
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class OddsTotalHt extends Model
|
class OddsTotalHt extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'odds_totals';
|
protected $table = 'odds_totals_ht';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'id',
|
'id',
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('odds3way_hts', function (Blueprint $table) {
|
Schema::create('odds_3ways_ht', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
|
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
|
||||||
$table->integer('sport_id')->index()->references('id')->on('sports');
|
$table->integer('sport_id')->index()->references('id')->on('sports');
|
||||||
@@ -34,6 +34,6 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down(): void
|
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
|
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
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('odds_point_ht', function (Blueprint $table) {
|
Schema::create('odds_points_ht', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
|
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
|
||||||
$table->integer('sport_id')->index()->references('id')->on('sports');
|
$table->integer('sport_id')->index()->references('id')->on('sports');
|
||||||
@@ -35,6 +35,6 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down(): void
|
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
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('odds_total_hts', function (Blueprint $table) {
|
Schema::create('odds_totals_ht', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
|
$table->foreignId('event_id')->index()->constrained()->cascadeOnDelete()->references('id')->on('events');
|
||||||
$table->integer('sport_id')->index()->references('id')->on('sports');
|
$table->integer('sport_id')->index()->references('id')->on('sports');
|
||||||
@@ -35,6 +35,6 @@ return new class extends Migration
|
|||||||
*/
|
*/
|
||||||
public function down(): void
|
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) {
|
Schema::create('bettype_users', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->integer('user_id');
|
$table->integer('user_id')->index();
|
||||||
$table->integer('sport_id')->index()->references('id')->on('sports');
|
$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->boolean('is_active')->default(false);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,26 +12,36 @@ class MultilineSettingSeeder extends Seeder
|
|||||||
/**
|
/**
|
||||||
* Clients
|
* 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
|
VALUES
|
||||||
(1, 1, '1X2', '1X2', 'odds_3ways', 4, 1, '2025-12-14 09:25:48', '2025-12-14 09:25:48'),
|
(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'),
|
(1, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:32:38', '2025-12-14 09:32:38'),
|
||||||
(3, 1, 'DRAW NO BET', 'DNB', 'odds_dnb', 4, 0, '2025-12-14 09:31:42', '2025-12-14 09:31:42'),
|
(1, '1X2 HALF TIME', '1X2 HT', 'odds_3ways_ht', 4, 1, '2025-12-14 09:25:48', '2025-12-14 09:25:48'),
|
||||||
(4, 1, 'GOAL NO GOAL', 'GGNG', 'odds_ggng', 4, 0, '2025-12-14 09:31:56', '2025-12-14 09:31:56'),
|
(1, 'TOTALS HALF TIME', 'OU HT', 'odds_totals_ht', 4, 1, '2025-12-14 09:32:38', '2025-12-14 09:32:38'),
|
||||||
(5, 1, 'TO QUALIFY', 'TQ', 'odds_tq', 4, 0, '2025-12-14 09:32:19', '2025-12-14 09:32:19'),
|
(1, 'GOAL NO GOAL', 'GGNG', 'odds_ggng', 4, 0, '2025-12-14 09:31:56', '2025-12-14 09:31:56'),
|
||||||
(6, 1, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:32:38', '2025-12-14 09:32:38'),
|
(1, 'DOUBLE CHANCE', 'DC', 'odds_dc', 4, 1, '2025-12-14 09:31:22', '2025-12-14 09:32:55'),
|
||||||
(7, 3, 'MONEY LINE', 'ML', 'odds_2ways', 4, 0, '2025-12-14 09:37:32', '2025-12-14 09:37:32'),
|
(1, 'TO QUALIFY', 'TQ', 'odds_tq', 4, 0, '2025-12-14 09:32:19', '2025-12-14 09:32:19'),
|
||||||
(8, 3, 'HANDICAP', 'HC', 'odds_points', 4, 1, '2025-12-14 09:38:05', '2025-12-14 09:38:05'),
|
(1, 'DRAW NO BET', 'DNB', 'odds_dnb', 4, 0, '2025-12-14 09:31:42', '2025-12-14 09:31:42'),
|
||||||
(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'),
|
(2, '1X2', '1X2', 'odds_3ways', 4, 1, '2025-12-14 09:41:34', '2025-12-14 09:41:34'),
|
||||||
(11, 3, 'TOTALS FIRST QUARTER', 'OUQ1', 'odds_totals_q1', 4, 1, '2025-12-14 09:39:12', '2025-12-14 09:39:59'),
|
(2, 'MONEY LINE', 'ML', 'odds_2ways', 4, 0, '2025-12-14 09:41:21', '2025-12-14 09:41:21'),
|
||||||
(12, 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'),
|
||||||
(13, 2, '1X2', '1X2', 'odds_3ways', 4, 1, '2025-12-14 09:41:34', '2025-12-14 09:41:34'),
|
(2, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:42:13', '2025-12-14 09:42:13'),
|
||||||
(14, 2, 'HANDICAP', 'HC', 'odds_points', 4, 1, '2025-12-14 09:41:56', '2025-12-14 09:41:56'),
|
(2, 'POINTS FIRST QUARTER', 'HC Q1', 'odds_points_q1', 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'),
|
(2, 'TOTALS FIRST QUARTER', 'OU Q1', 'odds_totals_q1', 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'),
|
(3, 'MONEY LINE', 'ML', 'odds_2ways', 4, 0, '2025-12-14 09:37:32', '2025-12-14 09:37:32'),
|
||||||
(18, 5, 'TOTALS', 'OU', 'odds_totals', 4, 1, '2025-12-14 09:44:26', '2025-12-14 09:44:26');
|
(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);
|
DB::unprepared($sql);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user