feat: 扩展玩法配置快照字段并切换目录生效来源
This commit is contained in:
@@ -54,10 +54,18 @@ final class PlayConfigStreamService
|
||||
PlayConfigItem::query()->create([
|
||||
'version_id' => $draft->id,
|
||||
'play_code' => $row->play_code,
|
||||
'category' => $row->category,
|
||||
'dimension' => $row->dimension,
|
||||
'bet_mode' => $row->bet_mode,
|
||||
'display_name_zh' => $row->display_name_zh,
|
||||
'display_name_en' => $row->display_name_en,
|
||||
'display_name_ne' => $row->display_name_ne,
|
||||
'is_enabled' => $row->is_enabled,
|
||||
'min_bet_amount' => $row->min_bet_amount,
|
||||
'max_bet_amount' => $row->max_bet_amount,
|
||||
'display_order' => $row->display_order,
|
||||
'supports_multi_number' => $row->supports_multi_number,
|
||||
'reserved_rule_json' => $row->reserved_rule_json,
|
||||
'rule_text_zh' => $row->rule_text_zh,
|
||||
'rule_text_en' => $row->rule_text_en,
|
||||
'rule_text_ne' => $row->rule_text_ne,
|
||||
@@ -69,10 +77,18 @@ final class PlayConfigStreamService
|
||||
PlayConfigItem::query()->create([
|
||||
'version_id' => $draft->id,
|
||||
'play_code' => $pt->play_code,
|
||||
'category' => $pt->category,
|
||||
'dimension' => $pt->dimension,
|
||||
'bet_mode' => $pt->bet_mode,
|
||||
'display_name_zh' => $pt->display_name_zh,
|
||||
'display_name_en' => $pt->display_name_en,
|
||||
'display_name_ne' => $pt->display_name_ne,
|
||||
'is_enabled' => (bool) $pt->is_enabled,
|
||||
'min_bet_amount' => 100,
|
||||
'max_bet_amount' => 500_000_000,
|
||||
'display_order' => (int) $pt->sort_order,
|
||||
'supports_multi_number' => (bool) $pt->supports_multi_number,
|
||||
'reserved_rule_json' => $pt->reserved_rule_json,
|
||||
'rule_text_zh' => null,
|
||||
'rule_text_en' => null,
|
||||
'rule_text_ne' => null,
|
||||
@@ -97,10 +113,18 @@ final class PlayConfigStreamService
|
||||
PlayConfigItem::query()->create([
|
||||
'version_id' => $draft->id,
|
||||
'play_code' => (string) $row['play_code'],
|
||||
'category' => $row['category'] ?? null,
|
||||
'dimension' => $row['dimension'] ?? null,
|
||||
'bet_mode' => $row['bet_mode'] ?? null,
|
||||
'display_name_zh' => $row['display_name_zh'] ?? null,
|
||||
'display_name_en' => $row['display_name_en'] ?? null,
|
||||
'display_name_ne' => $row['display_name_ne'] ?? null,
|
||||
'is_enabled' => (bool) ($row['is_enabled'] ?? true),
|
||||
'min_bet_amount' => (int) ($row['min_bet_amount'] ?? 0),
|
||||
'max_bet_amount' => (int) ($row['max_bet_amount'] ?? 0),
|
||||
'display_order' => (int) ($row['display_order'] ?? 0),
|
||||
'supports_multi_number' => (bool) ($row['supports_multi_number'] ?? false),
|
||||
'reserved_rule_json' => $row['reserved_rule_json'] ?? null,
|
||||
'rule_text_zh' => isset($row['rule_text_zh']) ? (string) $row['rule_text_zh'] : null,
|
||||
'rule_text_en' => isset($row['rule_text_en']) ? (string) $row['rule_text_en'] : null,
|
||||
'rule_text_ne' => isset($row['rule_text_ne']) ? (string) $row['rule_text_ne'] : null,
|
||||
@@ -221,6 +245,14 @@ final class PlayConfigStreamService
|
||||
if ($maxBet < $minBet) {
|
||||
$errors["items.$index.max_bet_amount"][] = '最大下注额不能小于最小下注额';
|
||||
}
|
||||
|
||||
if ($row->display_name_zh === null || $row->display_name_zh === '') {
|
||||
$errors["items.$index.display_name_zh"][] = '显示名称不能为空';
|
||||
}
|
||||
|
||||
if ($row->display_order === null) {
|
||||
$errors["items.$index.display_order"][] = '排序不能为空';
|
||||
}
|
||||
}
|
||||
|
||||
if ($errors !== []) {
|
||||
|
||||
Reference in New Issue
Block a user