feat: 切换 schema dump 基线并增强返点结算与管理校验

This commit is contained in:
2026-06-08 17:41:41 +08:00
parent 2d32f006c5
commit 8d5d7f5b17
130 changed files with 5746 additions and 6723 deletions

View File

@@ -55,7 +55,7 @@ final class AdminPlayerStoreController extends Controller
if ($isNative) {
$sitePlayerId = $sitePlayerId !== ''
? $sitePlayerId
: 'native:'.Str::lower(Str::ulid());
: $this->generateNativeSitePlayerId($siteCode);
}
if ($sitePlayerId === '') {
@@ -192,4 +192,20 @@ final class AdminPlayerStoreController extends Controller
return $rootId !== null ? (int) $rootId : null;
}
private function generateNativeSitePlayerId(string $siteCode): string
{
$prefix = strtoupper(substr(preg_replace('/[^A-Za-z]/', '', $siteCode) ?: 'LP', 0, 2));
$prefix = str_pad($prefix, 2, 'P');
do {
$candidate = sprintf('%s%06d', $prefix, random_int(0, 999999));
$exists = Player::query()
->where('site_code', $siteCode)
->where('site_player_id', $candidate)
->exists();
} while ($exists);
return $candidate;
}
}