1.新增默认彩金池配置
2.优化关联彩金池配置的名称显示 3.优化一键测试权重 4.优化底注配置
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -92,7 +92,7 @@ class DicePlayRecordController extends BaseController
|
||||
#[Permission('玩家抽奖记录列表', 'dice:play_record:index:index')]
|
||||
public function getLotteryConfigOptions(Request $request): Response
|
||||
{
|
||||
$query = DiceLotteryPoolConfig::field('id,name')->order('id', 'asc');
|
||||
$query = DiceLotteryPoolConfig::field('id,name,remark')->order('id', 'asc');
|
||||
$requestDeptId = AdminScopeHelper::pickRequestDeptId(
|
||||
$request->input('dept_id'),
|
||||
$request->all()
|
||||
@@ -100,7 +100,13 @@ class DicePlayRecordController extends BaseController
|
||||
AdminScopeHelper::applyConfigScope($query, $this->adminInfo ?? null, $requestDeptId);
|
||||
$list = $query->select();
|
||||
$data = $list->map(function ($item) {
|
||||
return ['id' => (int) $item['id'], 'name' => (string) ($item['name'] ?? '')];
|
||||
$row = is_array($item) ? $item : $item->toArray();
|
||||
return [
|
||||
'id' => (int) ($row['id'] ?? 0),
|
||||
'name' => (string) ($row['name'] ?? ''),
|
||||
'remark' => (string) ($row['remark'] ?? ''),
|
||||
'display_name' => DiceLotteryPoolConfig::displayLabel($row),
|
||||
];
|
||||
})->toArray();
|
||||
return $this->success($data);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class DicePlayerController extends BaseController
|
||||
#[Permission('玩家列表', 'dice:player:index:index')]
|
||||
public function getLotteryConfigOptions(Request $request): Response
|
||||
{
|
||||
$query = DiceLotteryPoolConfig::field('id,name')->order('id', 'asc');
|
||||
$query = DiceLotteryPoolConfig::field('id,name,remark')->order('id', 'asc');
|
||||
$requestDeptId = AdminScopeHelper::pickRequestDeptId(
|
||||
$request->input('dept_id'),
|
||||
$request->all()
|
||||
@@ -51,7 +51,13 @@ class DicePlayerController extends BaseController
|
||||
AdminScopeHelper::applyConfigScope($query, $this->adminInfo ?? null, $requestDeptId);
|
||||
$list = $query->select();
|
||||
$data = $list->map(function ($item) {
|
||||
return ['id' => (int) $item['id'], 'name' => (string) ($item['name'] ?? '')];
|
||||
$row = is_array($item) ? $item : $item->toArray();
|
||||
return [
|
||||
'id' => (int) ($row['id'] ?? 0),
|
||||
'name' => (string) ($row['name'] ?? ''),
|
||||
'remark' => (string) ($row['remark'] ?? ''),
|
||||
'display_name' => DiceLotteryPoolConfig::displayLabel($row),
|
||||
];
|
||||
})->toArray();
|
||||
return $this->success($data);
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@ class DiceRewardController extends BaseController
|
||||
'test_safety_line' => $post['test_safety_line'] ?? null,
|
||||
'dept_id' => $post['dept_id'] ?? null,
|
||||
'ante_config_id' => $post['ante_config_id'] ?? null,
|
||||
'ante_random' => $post['ante_random'] ?? null,
|
||||
];
|
||||
$adminId = isset($this->adminInfo['id']) ? (int) $this->adminInfo['id'] : null;
|
||||
$requestDeptId = AdminScopeHelper::pickRequestDeptId($request->input('dept_id'), $post);
|
||||
|
||||
Reference in New Issue
Block a user