1.新增默认彩金池配置

2.优化关联彩金池配置的名称显示
3.优化一键测试权重
4.优化底注配置
This commit is contained in:
2026-06-04 12:21:57 +08:00
parent 5d316ef7d6
commit dfb37dd33a
40 changed files with 845 additions and 177 deletions

View File

@@ -38,19 +38,23 @@ class DiceLotteryPoolConfigController extends BaseController
#[Permission('色子奖池配置列表', 'dice:lottery_pool_config:index:index')]
public function getOptions(Request $request): Response
{
$query = DiceLotteryPoolConfig::field('id,name,t1_weight,t2_weight,t3_weight,t4_weight,t5_weight')
$query = DiceLotteryPoolConfig::field('id,name,remark,t1_weight,t2_weight,t3_weight,t4_weight,t5_weight')
->order('id', 'asc');
AdminScopeHelper::applyConfigScope($query, $this->adminInfo ?? null, $request->input('dept_id'));
$list = $query->select();
$data = $list->map(function ($item) {
$row = is_array($item) ? $item : $item->toArray();
$display = DiceLotteryPoolConfig::displayLabel($row);
return [
'id' => (int) $item['id'],
'name' => (string) ($item['name'] ?? ''),
't1_weight' => (int) ($item['t1_weight'] ?? 0),
't2_weight' => (int) ($item['t2_weight'] ?? 0),
't3_weight' => (int) ($item['t3_weight'] ?? 0),
't4_weight' => (int) ($item['t4_weight'] ?? 0),
't5_weight' => (int) ($item['t5_weight'] ?? 0),
'id' => (int) ($row['id'] ?? 0),
'name' => (string) ($row['name'] ?? ''),
'remark' => (string) ($row['remark'] ?? ''),
'display_name' => $display,
't1_weight' => (int) ($row['t1_weight'] ?? 0),
't2_weight' => (int) ($row['t2_weight'] ?? 0),
't3_weight' => (int) ($row['t3_weight'] ?? 0),
't4_weight' => (int) ($row['t4_weight'] ?? 0),
't5_weight' => (int) ($row['t5_weight'] ?? 0),
];
})->toArray();
return $this->success($data);