From e312154b0f6e3a68bf66702dd530b06d02d8a0c6 Mon Sep 17 00:00:00 2001 From: zhenhui <1276357500@qq.com> Date: Sat, 7 Mar 2026 11:09:41 +0800 Subject: [PATCH] =?UTF-8?q?DicePlayRecord=E6=B7=BB=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5super=5Fwin=5Fcoin=E5=92=8Creward=5Fwin=5Fcoin?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E4=B8=8D=E5=90=8C=E7=9A=84=E4=B8=AD=E5=A5=96?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/dice/api/lottery_config/index.ts | 17 +++- .../plugin/dice/play_record/index/index.vue | 10 ++- .../play_record/index/modules/edit-dialog.vue | 32 +++++++- .../index/modules/table-search.vue | 4 +- .../views/plugin/dice/player/index/index.vue | 24 ++---- .../dice/player/index/modules/edit-dialog.vue | 82 +++++++++++++++---- .../player/index/modules/table-search.vue | 30 +++++-- server/app/api/controller/GameController.php | 3 + server/app/api/logic/PlayStartLogic.php | 24 +++++- server/app/api/logic/UserLogic.php | 2 +- .../player/DicePlayerController.php | 3 +- .../lottery_config/DiceLotteryConfig.php | 9 ++ .../dice/model/play_record/DicePlayRecord.php | 58 ++++++++++++- server/app/dice/model/player/DicePlayer.php | 15 +++- .../model/reward_config/DiceRewardConfig.php | 27 +++++- 15 files changed, 280 insertions(+), 60 deletions(-) diff --git a/saiadmin-artd/src/views/plugin/dice/api/lottery_config/index.ts b/saiadmin-artd/src/views/plugin/dice/api/lottery_config/index.ts index aeb9984..7a67a6b 100644 --- a/saiadmin-artd/src/views/plugin/dice/api/lottery_config/index.ts +++ b/saiadmin-artd/src/views/plugin/dice/api/lottery_config/index.ts @@ -5,7 +5,7 @@ import request from '@/utils/http' */ export default { /** - * 获取数据列表 + * 获取数据列表(DiceLotteryConfig) * @param params 搜索参数 * @returns 数据列表 */ @@ -16,6 +16,21 @@ export default { }) }, + /** + * 获取彩金池配置下拉选项(来自 DiceLotteryConfig,用于 lottery_config_id 选择) + * @returns { id, name }[] + */ + async getOptions(): Promise> { + const res = await request.get({ + url: '/dice/lottery_config/DiceLotteryConfig/index', + params: { limit: 500, page: 1 } + }) + const rows = (res?.data?.data ?? res?.data?.rows ?? []) as Array<{ id: number; name: string }> + return Array.isArray(rows) + ? rows.map((r) => ({ id: Number(r.id), name: String(r.name ?? r.id) })) + : [] + }, + /** * 读取数据 * @param id 数据ID diff --git a/saiadmin-artd/src/views/plugin/dice/play_record/index/index.vue b/saiadmin-artd/src/views/plugin/dice/play_record/index/index.vue index 63e8104..dde5119 100644 --- a/saiadmin-artd/src/views/plugin/dice/play_record/index/index.vue +++ b/saiadmin-artd/src/views/plugin/dice/play_record/index/index.vue @@ -56,10 +56,10 @@ {{ row.lottery_type === 0 ? '付费' : row.lottery_type === 1 ? '赠送' : '-' }} - + @@ -182,8 +182,10 @@ useSlot: true }, { prop: 'lottery_type', label: '抽奖类型', width: 100, useSlot: true }, - { prop: 'is_win', label: '中奖', width: 80, useSlot: true }, - { prop: 'win_coin', label: '赢取平台币' }, + { prop: 'is_win', label: '是否中大奖', width: 100, useSlot: true }, + { prop: 'win_coin', label: '赢取平台币', width: 110 }, + { prop: 'super_win_coin', label: '中大奖平台币', width: 120 }, + { prop: 'reward_win_coin', label: '摇色子中奖平台币', width: 140 }, { prop: 'direction', label: '方向', width: 90, useSlot: true }, { prop: 'start_index', label: '起始索引', width: 90 }, { prop: 'target_index', label: '终点索引', width: 90 }, diff --git a/saiadmin-artd/src/views/plugin/dice/play_record/index/modules/edit-dialog.vue b/saiadmin-artd/src/views/plugin/dice/play_record/index/modules/edit-dialog.vue index e11cd05..7be20f6 100644 --- a/saiadmin-artd/src/views/plugin/dice/play_record/index/modules/edit-dialog.vue +++ b/saiadmin-artd/src/views/plugin/dice/play_record/index/modules/edit-dialog.vue @@ -54,7 +54,7 @@ - + - + + + + + + + - + - + diff --git a/saiadmin-artd/src/views/plugin/dice/player/index/index.vue b/saiadmin-artd/src/views/plugin/dice/player/index/index.vue index c6f3eba..d8dfa93 100644 --- a/saiadmin-artd/src/views/plugin/dice/player/index/index.vue +++ b/saiadmin-artd/src/views/plugin/dice/player/index/index.vue @@ -112,7 +112,7 @@ phone: undefined, status: undefined, coin: undefined, - is_up: undefined + lottery_config_id: undefined }) // 搜索处理 @@ -127,17 +127,9 @@ return cellValue != null && cellValue !== '' ? `${cellValue}%` : '-' } - // 倍率列展示:0=正常 1=强制杀猪 2=T1高倍率 - const isUpFormatter = (row: any) => { - const cellValue = row.is_up - return cellValue === 0 - ? '正常' - : cellValue === 1 - ? '强制杀猪' - : cellValue === 2 - ? 'T1高倍率' - : '-' - } + // 彩金池配置列:lottery_config_id 关联 DiceLotteryConfig,显示 name + const lotteryConfigNameFormatter = (row: any) => + row?.diceLotteryConfig?.name ?? (row?.lottery_config_id ? `#${row.lottery_config_id}` : '自定义') // 表格配置 const { @@ -176,11 +168,11 @@ useSlot: true }, { - prop: 'is_up', - label: '倍率', - width: 80, + prop: 'lottery_config_id', + label: '彩金池配置', + width: 120, align: 'center', - formatter: isUpFormatter + formatter: (row: any) => lotteryConfigNameFormatter(row) }, { prop: 't1_weight', diff --git a/saiadmin-artd/src/views/plugin/dice/player/index/modules/edit-dialog.vue b/saiadmin-artd/src/views/plugin/dice/player/index/modules/edit-dialog.vue index 4a23886..f2a85dd 100644 --- a/saiadmin-artd/src/views/plugin/dice/player/index/modules/edit-dialog.vue +++ b/saiadmin-artd/src/views/plugin/dice/player/index/modules/edit-dialog.vue @@ -15,7 +15,13 @@ - + - - - - - + + + + - + - + - + - + - + - +
五个池权重总和:{{ weightsSum @@ -78,9 +94,12 @@