feat(lottery): 扩展传统马来赔率、玩法结算与开注商短码支持
Some checks failed
lotterLaravel CI / test (push) Has been cancelled
lotterLaravel E2E / e2e-api (push) Has been cancelled

This commit is contained in:
2026-07-10 17:04:28 +08:00
parent 2ea3e810a0
commit cbb18b976f
24 changed files with 320 additions and 45 deletions

View File

@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('bet_providers', function (Blueprint $table): void {
$table->string('short_code', 1)->nullable()->after('name');
});
DB::table('bet_providers')->orderBy('id')->get(['id', 'code'])->each(function (object $provider): void {
DB::table('bet_providers')
->where('id', $provider->id)
->update(['short_code' => strtoupper(substr((string) $provider->code, 0, 1))]);
});
}
public function down(): void
{
Schema::table('bet_providers', function (Blueprint $table): void {
$table->dropColumn('short_code');
});
}
};