Compare commits
17 Commits
77ec0dcade
...
master-v3
| Author | SHA1 | Date | |
|---|---|---|---|
| d3ee3faec4 | |||
| 765f50963a | |||
| ef684a1c55 | |||
| a8973d4e47 | |||
| 9f42cffd18 | |||
| edd870457f | |||
| 7493c4e400 | |||
| b0e5a3f5c0 | |||
| 6ed34b97df | |||
| d54a9c9281 | |||
| afd6113927 | |||
| 2f05ac0cd9 | |||
| ded5e82e16 | |||
| e2273ef41c | |||
| 0bdab95ab7 | |||
| cfc6537f97 | |||
| e32f3890f1 |
199
README.md
199
README.md
@@ -1,99 +1,146 @@
|
|||||||
<p align="center">
|
# 大富翁 · 摇色子 — 项目文档
|
||||||
<img src="https://saithink.top/images/logo.png" width="120" />
|
|
||||||
</p>
|
|
||||||
<p align="center">
|
|
||||||
<img src="https://svg.hamm.cn/badge.svg?key=License&value=MIT" />
|
|
||||||
<img src="https://svg.hamm.cn/badge.svg?key=Version&value=6.x" />
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div style="padding:18px;max-width: 1024px;margin:0 auto;">
|
本文描述**业务玩法**与**服务端抽奖/结算机制**,便于产品、运营与二次开发对齐实现。接口路径、鉴权与联调细节见根目录 [`API对接文档.md`](API对接文档.md)。
|
||||||
<h1>SaiAdmin 6.x</h1>
|
|
||||||
|
|
||||||
## 项目简介
|
|
||||||
|
|
||||||
SaiAdmin 是一个基于 [Webman](https://www.workerman.net/webman) 的高性能后台管理系统插件。它提供了完整的权限管理、系统配置、代码生成等功能,帮助开发者快速构建企业级应用。
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ✨ 核心特性
|
## 1. 项目概述
|
||||||
|
|
||||||
- **🚀 高性能** - 基于 Webman 常驻内存框架,性能优异
|
- **形态**:平台玩家使用「平台币」参与摇五颗标准六面骰(点数各 1–6),结果对应棋盘/奖励配置;后台可配置档位权重、奖池、杀分策略与展示文案(含中英文)。
|
||||||
- **🔐 完整权限系统** - RBAC 权限模型,支持用户、角色、部门、岗位管理
|
- **服务端**:PHP [Webman](https://www.workerman.net/webman)(`server/`),玩家与平台接口在 `app/api`;骰子业务模型在 `app/dice`。
|
||||||
- **📝 代码生成器** - 一键生成 CRUD 代码,提升开发效率
|
- **管理端**:前端工程 `saiadmin-artd/`(与 SaiAdmin 插件体系配套)。
|
||||||
- **⚡ 双 ORM 支持** - 同时支持 ThinkORM 和 Eloquent ORM
|
|
||||||
- **🔧 插件化架构** - 支持插件扩展,便于功能模块化
|
|
||||||
- **📊 系统监控** - 内置服务器监控、缓存管理功能
|
|
||||||
- **📋 日志系统** - 完整的登录日志和操作日志记录
|
|
||||||
|
|
||||||
## 🛠️ 功能模块
|
---
|
||||||
|
|
||||||
### 系统管理
|
## 2. 核心概念
|
||||||
|
|
||||||
| 模块 | 说明 |
|
| 概念 | 说明 |
|
||||||
| ---------- | -------------------------------- |
|
| --- | --- |
|
||||||
| 用户管理 | 用户增删改查、密码管理、缓存清理 |
|
| **平台币 `coin`** | 玩家钱包余额;付费开局、购买套餐、中奖结算均围绕该字段。 |
|
||||||
| 角色管理 | 角色 CRUD、菜单权限分配 |
|
| **注数 `ante`** | 倍数因子,须存在于表 `dice_ante_config` 的 `mult` 中;接口 `/api/game/anteConfig` 返回可选注数。 |
|
||||||
| 部门管理 | 组织架构管理、树形结构 |
|
| **单注费用** | 付费抽奖时,开局前扣除 **`ante × 1`** 平台币(代码常量 `UNIT_COST = 1`,即「单注 1 币」口径)。 |
|
||||||
| 岗位管理 | 岗位信息维护、Excel 模板导入导出 |
|
| **方向 `direction`** | 开局参数:`0` 与 `1` 对应两套奖励数据(顺时针/逆时针或「无 / 中奖」分支,由前端与配置表共同约定);服务端在 **档位确定后**,按当前方向从 `DiceReward` 缓存结构中取该档位下的条目再按权重抽取。 |
|
||||||
| 菜单管理 | 菜单配置、按钮权限 |
|
| **档位 T1–T5** | 中奖层级;先抽档位,再在该档位 + 当前方向下按 `weight` 抽一条奖励配置。 |
|
||||||
| 字典管理 | 字典类型与字典数据维护 |
|
| **`grid_number`(5–30)** | 与「五颗骰子点数之和」一致:最小 5(全 1),最大 30(全 6);用于关联奖励行与后续生成 `roll_array`。 |
|
||||||
| 附件管理 | 文件上传、分类管理、资源移动 |
|
| **`real_ev`** | 奖励配置中的期望调节项;**普通中奖**结算为 **`real_ev × ante`**(付费局在开局已扣 `ante×1`,净效果依 `real_ev` 而定)。 |
|
||||||
| 系统配置 | 分组配置、邮件设置、动态参数 |
|
|
||||||
| 日志管理 | 登录日志、操作日志查询与清理 |
|
|
||||||
| 服务监控 | 服务器状态、缓存信息、一键清理 |
|
|
||||||
| 数据表维护 | 数据表结构、表优化、碎片整理 |
|
|
||||||
|
|
||||||
### 开发工具
|
---
|
||||||
|
|
||||||
| 模块 | 说明 |
|
## 3. 玩法流程(玩家视角)
|
||||||
| -------- | ---------------------------- |
|
|
||||||
| 代码生成 | 根据数据表自动生成 CRUD 代码 |
|
|
||||||
| 定时任务 | Crontab 任务管理、执行日志 |
|
|
||||||
|
|
||||||
<h1>学习</h1>
|
1. **登录 / 进游戏**
|
||||||
|
平台侧通过 `/api/v1/getGameUrl` 或玩家侧 `/api/user/Login` 换取 token,打开前端页面。
|
||||||
|
|
||||||
<ul>
|
2. **(可选)购买「抽奖券」套餐**
|
||||||
<li>
|
`POST /api/game/buyLotteryTickets`,`count` 仅支持 `1`、`5`、`10`:
|
||||||
<a href="https://saithink.top" target="_blank">主页 / Home page</a>
|
- 1:1 币 → 1 次付费计数 + 0 次赠送
|
||||||
</li>
|
- 5:5 币 → 5 次付费 + **1 次赠送**(共 6 次计入总次数)
|
||||||
<li>
|
- 10:10 币 → 10 次付费 + **3 次赠送**(共 13 次)
|
||||||
<a href="https://saithink.top/documents/v6/" target="_blank">文档 / Document</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
会更新玩家身上的 `total_ticket_count` / `paid_ticket_count` / `free_ticket_count`,并记钱包与券流水。
|
||||||
|
|
||||||
<h1>演示地址</h1>
|
3. **开局抽奖**
|
||||||
<p>演示地址: <a href="http://v6.saithink.top" target="_blank">http://v6.saithink.top</a></p>
|
`POST /api/game/playStart`,需传 **`direction`(0 或 1)** 与 **`ante`(正整数,且须在底注配置中)**。
|
||||||
<p>演示账号:admin</p>
|
|
||||||
<p>演示密码:123456</p>
|
|
||||||
|
|
||||||
<h1>共同交流</h1>
|
4. **付费 vs 免费**
|
||||||
|
- **免费抽奖**:当 `free_ticket_count > 0` 时,本局视为免费类型:不扣 `ante×1`,但会消耗 **1 次** `free_ticket_count`。
|
||||||
|
- **付费抽奖**:不依赖「券张数是否大于 0」;只要非免费局,开局前扣 **`ante × 1`**。
|
||||||
|
|
||||||
<table>
|
> **重要**:当前实现已**不再用「抽奖券张数」作为能否开局的条件**;`buyLotteryTickets` 更新的是统计与赠送次数,**真正开局仍看余额、注数、免费次数等规则**(见下节)。
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td align="center" valign="middle">
|
|
||||||
<img src="https://saithink.top/images/me.png" class="no-zoom" width="180px">
|
|
||||||
<p>saiadmin交流群(添加我微信备注"saiadmin")</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<h1>支持项目</h1>
|
5. **免费注数锁定**
|
||||||
|
若上一局因命中 **T5** 赠送了免费次数,服务端会缓存「免费局须与触发时相同的 `ante`」,不一致则拒绝并提示修改注数。
|
||||||
|
|
||||||
如果您正在使用这个项目并感觉良好,或者是想支持我继续开发,您可以通过如下`任意`方式支持我:
|
---
|
||||||
|
|
||||||
谢谢! ❤️
|
## 4. 抽奖与结算机制(服务端逻辑)
|
||||||
|
|
||||||
|
以下对应 `PlayStartLogic` 与 `LotteryService`,便于理解「先抽什么、再算什么钱」。
|
||||||
|
|
||||||
| 微信 | 支付宝 |
|
### 4.1 前置校验
|
||||||
| :------------------------------------------------------------------------------: | :------------------------------------------------------------------------------: |
|
|
||||||
| <img src="https://saithink.top/images/wechat.png" alt="Wechat QRcode" width=180> | <img src="https://saithink.top/images/alipay.png" alt="Alipay QRcode" width=180> |
|
|
||||||
|
|
||||||
<div style="clear: both">
|
- 用户存在;`ante` 合法。
|
||||||
<h1>LICENSE</h1>
|
- **最低余额**:`coin ≥ abs(min_real_ev) × ante`(`min_real_ev` 来自全表 `DiceRewardConfig` 缓存),防止极端负 EV 下余额不足以覆盖风险口径。
|
||||||
This project is open-sourced software licensed under the MIT.
|
- 付费局:`coin ≥ ante × 1`。
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
### 4.2 使用哪套「档位权重」:默认奖池 vs 杀分奖池
|
||||||
|
|
||||||
|
配置表 `dice_lottery_pool_config` 至少要有 **`name = default`**;可选 **`name = killScore`**。
|
||||||
|
|
||||||
|
- **`default` 彩金池**维护累计盈利字段 **`profit_amount`**(见 4.5)。
|
||||||
|
- 记:`safety_line` = 安全线,`kill_enabled` = 是否开启杀分。
|
||||||
|
|
||||||
|
**是否按「奖池档位权重」抽档位(`usePoolWeights`)**:
|
||||||
|
|
||||||
|
| 情形 | 档位权重来源 |
|
||||||
|
| --- | --- |
|
||||||
|
| **免费局** | 使用 **killScore** 奖池的 T1–T5 权重;若无 `killScore` 则退回 `default`。 |
|
||||||
|
| **付费局** 且 **杀分开启** 且 **`profit_amount ≥ safety_line`** 且 **存在 killScore** | 使用 **killScore** 的档位权重(杀分模式)。 |
|
||||||
|
| **其他付费局** | 使用 **玩家**身上的 `t1_weight`~`t5_weight`(`DicePlayer` 字段,与 `LotteryService::drawTierByPlayerWeights` 一致)。 |
|
||||||
|
|
||||||
|
档位抽出 **T1–T5** 后,从 `DiceReward` 缓存中取出 **`[该档位][direction]`** 下的所有奖励行,再按行 **`weight`** 做加权随机(仅 `weight > 0` 参与;全为 0 会重试档位,最多约 10 次)。
|
||||||
|
|
||||||
|
### 4.3 杀分模式下的特殊处理
|
||||||
|
|
||||||
|
当使用 **killScore / 免费局** 等与杀分一致的权重路径时:
|
||||||
|
|
||||||
|
- 在奖励抽取阶段会 **排除 `grid_number` 为 5 和 30 的配置**(这两点数和只能对应「全 1」「全 6」豹子,无法做成非豹子展示)。
|
||||||
|
- **不会触发豹子大奖**(见 4.4):若摇到豹子点数组,只生成 **非豹子** 的五骰组合,不发放豹子附加奖金。
|
||||||
|
|
||||||
|
### 4.4 普通奖与「豹子 / BIGWIN」
|
||||||
|
|
||||||
|
- 若本次抽中的 `grid_number` **不是**「豹子集合」`{5,10,15,20,25,30}`:按点数和生成 5 个 1–6 的骰子(和为 `grid_number`),**普通奖金** = **`real_ev × ante`**(付费局已预先扣除 `ante×1`)。
|
||||||
|
|
||||||
|
- 若点数和落在豹子集合:
|
||||||
|
- **`grid_number` 为 5 或 30**:若**非**杀分路径,**必定**按豹子结算(五颗相同点数)。
|
||||||
|
- **10 / 15 / 20 / 25**:读取 `DiceRewardConfig` 中 **`tier = BIGWIN`** 且对应该 `grid_number` 的配置,用其 **`weight`(0–10000,10000=100%)** 随机决定是否视为真豹子;否则生成**非豹子**但点数和不变的骰子组合。
|
||||||
|
- **真豹子**时:奖金按 **`big_win_real_ev × ante`** 发放(`big_win_real_ev` 来自 BIGWIN 配置;若未配则用代码兜底常量);并**不计入**当次普通 `reward_win` 那条配置(与「中豹子不走普通奖」逻辑一致,详见代码注释)。
|
||||||
|
|
||||||
|
杀分路径下:**不触发**豹子奖,仅展示非豹子组合。
|
||||||
|
|
||||||
|
### 4.5 T5「再来一次」
|
||||||
|
|
||||||
|
若命中奖励属于 **T5** 档位(且未走「仅豹子清掉普通奖」的特殊分支):在事务内为玩家 **`free_ticket_count + 1`**,并写入券流水备注;同时写入 Redis:**下一局免费抽奖必须使用本局相同 `ante`**。
|
||||||
|
|
||||||
|
### 4.6 彩金池盈利累计
|
||||||
|
|
||||||
|
在 **`default`** 那条池子上更新 **`profit_amount`**:
|
||||||
|
|
||||||
|
- **付费局**:本局贡献 `+= (本局总中奖 win_coin) - (本局付费 paid_amount)`,其中 `paid_amount = ante × 1`。
|
||||||
|
- **免费局**:`+= win_coin`(无票价成本,`paid_amount = 0`)。
|
||||||
|
|
||||||
|
该累计值与 **`safety_line`、 `kill_enabled`** 共同决定下一局付费是否进入 **killScore** 档位权重(见 4.2)。
|
||||||
|
|
||||||
|
> 注意:仓库中部分数据库迁移脚本对 `profit_amount` 的注释可能仍沿用旧口径。当前行为应以 `PlayStartLogic` 中对 `profit_amount` 的实际累加逻辑为准。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. 数据与配置要点(实现侧)
|
||||||
|
|
||||||
|
- **`DiceReward`**:按档位、方向组织好的多语言/展示与 `grid_number`、`weight`、`real_ev` 等,供开局加权抽取。
|
||||||
|
- **`DiceRewardConfig`**:含 **BIGWIN** 档及普通档;`getCachedMinRealEv()` 等用于全局限定。
|
||||||
|
- **`dice_lottery_pool_config`**:`default` / `killScore` 的 T1–T5 权重及杀分相关开关、安全线、累计盈利。
|
||||||
|
- **对局表 `DicePlayRecord`**:记录 `lottery_config_id`、`lottery_type`(付费/免费)、`ante`、`paid_amount`、`roll_array`、`reward_tier`、各类中奖拆分字段等,供后台与平台对账。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. 接口与文档索引
|
||||||
|
|
||||||
|
| 文档 | 内容 |
|
||||||
|
| --- | --- |
|
||||||
|
| [`API对接文档.md`](API对接文档.md) | 平台 `/api/v1/*`(`auth-token`)、玩家 `/api/*`(`token`)、统一返回码、联调建议。 |
|
||||||
|
| `server/docs/` | 性能、权重测试、出点分析等专项说明(按需阅读)。 |
|
||||||
|
|
||||||
|
**与玩法直接相关的玩家接口示例**:
|
||||||
|
|
||||||
|
- `GET /api/game/config` — 前端文案与分组配置
|
||||||
|
- `GET /api/game/anteConfig` — 可选注数
|
||||||
|
- `GET /api/game/lotteryPool` — 彩金池展示列表(不含 BIGWIN 档)
|
||||||
|
- `POST /api/game/buyLotteryTickets` — 购买套餐(更新次数统计)
|
||||||
|
- `POST /api/game/playStart` — 开局一局(`direction`、`ante`)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. 修订说明
|
||||||
|
|
||||||
|
- 本文档依据 `server/app/api/logic/PlayStartLogic.php`、`GameLogic.php`、`LotteryService.php` 及 `GameController` 当前实现整理;若业务规则变更,请以代码与数据库迁移为准并同步更新本节与 [`API对接文档.md`](API对接文档.md)。
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
*/
|
*/
|
||||||
const clearCache = (): void => {
|
const clearCache = (): void => {
|
||||||
userStore.clearCache()
|
userStore.clearCache()
|
||||||
ElMessage.success('清理缓存成功')
|
ElMessage.success(t('uiMsg.clearCacheSuccess'))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
import { $t } from '@/locales'
|
||||||
|
|
||||||
defineOptions({ name: 'SaExport' })
|
defineOptions({ name: 'SaExport' })
|
||||||
|
|
||||||
@@ -42,18 +43,18 @@
|
|||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
if (loading.value) return
|
if (loading.value) return
|
||||||
if (!props.url) {
|
if (!props.url) {
|
||||||
ElMessage.error('未配置导出接口')
|
ElMessage.error($t('uiMsg.exportNotConfigured'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let finalFileName = props.fileName
|
let finalFileName = props.fileName
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { value } = await ElMessageBox.prompt('请输入导出文件名称', '提示', {
|
const { value } = await ElMessageBox.prompt($t('uiMsg.exportPromptFileName'), $t('uiMsg.titlePrompt'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
inputValue: props.fileName,
|
inputValue: props.fileName,
|
||||||
inputValidator: (val) => !!val.trim() || '文件名不能为空'
|
inputValidator: (val) => !!val.trim() || $t('uiMsg.exportFileNameRequired')
|
||||||
})
|
})
|
||||||
finalFileName = value
|
finalFileName = value
|
||||||
} catch {
|
} catch {
|
||||||
@@ -87,10 +88,10 @@
|
|||||||
reader.onload = () => {
|
reader.onload = () => {
|
||||||
try {
|
try {
|
||||||
const result = JSON.parse(reader.result as string)
|
const result = JSON.parse(reader.result as string)
|
||||||
ElMessage.error(result.msg || '导出失败')
|
ElMessage.error(result.msg || $t('uiMsg.exportFail'))
|
||||||
emit('error', result)
|
emit('error', result)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ElMessage.error('导出失败')
|
ElMessage.error($t('uiMsg.exportFail'))
|
||||||
emit('error', e)
|
emit('error', e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,11 +109,11 @@
|
|||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
URL.revokeObjectURL(url)
|
URL.revokeObjectURL(url)
|
||||||
|
|
||||||
ElMessage.success('导出成功')
|
ElMessage.success($t('uiMsg.exportSuccess'))
|
||||||
emit('success')
|
emit('success')
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
ElMessage.error(error.message || '导出失败')
|
ElMessage.error(error.message || $t('uiMsg.exportFail'))
|
||||||
emit('error', error)
|
emit('error', error)
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { ref, nextTick } from 'vue'
|
import { ref, nextTick } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SaiAdmin Composable
|
* SaiAdmin Composable
|
||||||
@@ -39,13 +40,13 @@ export function useSaiAdmin() {
|
|||||||
apiFn: (params: any) => Promise<any>,
|
apiFn: (params: any) => Promise<any>,
|
||||||
callback?: () => void
|
callback?: () => void
|
||||||
): void => {
|
): void => {
|
||||||
ElMessageBox.confirm(`确定要删除该数据吗?`, '删除数据', {
|
ElMessageBox.confirm($t('uiMsg.deleteConfirmSingle'), $t('uiMsg.titleDelete'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
apiFn({ ids: [row.id] }).then(() => {
|
apiFn({ ids: [row.id] }).then(() => {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success($t('uiMsg.deleteSuccess'))
|
||||||
if (callback) callback()
|
if (callback) callback()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -57,20 +58,20 @@ export function useSaiAdmin() {
|
|||||||
callback?: () => void
|
callback?: () => void
|
||||||
): void => {
|
): void => {
|
||||||
if (selectedRows.value.length === 0) {
|
if (selectedRows.value.length === 0) {
|
||||||
ElMessage.warning('请选择要删除的行')
|
ElMessage.warning($t('uiMsg.selectRowsToDelete'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
`确定要删除选中的 ${selectedRows.value.length} 条数据吗?`,
|
$t('uiMsg.deleteConfirmSelected', { n: selectedRows.value.length }),
|
||||||
'删除选中数据',
|
$t('uiMsg.titleDeleteSelected'),
|
||||||
{
|
{
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
apiFn({ ids: selectedRows.value.map((row) => row.id) }).then(() => {
|
apiFn({ ids: selectedRows.value.map((row) => row.id) }).then(() => {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success($t('uiMsg.deleteSuccess'))
|
||||||
if (callback) callback()
|
if (callback) callback()
|
||||||
selectedRows.value = []
|
selectedRows.value = []
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ const i18n: I18n = createI18n(i18nOptions)
|
|||||||
* 翻译函数类型
|
* 翻译函数类型
|
||||||
*/
|
*/
|
||||||
interface Translation {
|
interface Translation {
|
||||||
(key: string): string
|
(key: string, named?: Record<string, unknown>): string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -39,6 +39,46 @@
|
|||||||
"confirm": "Confirm",
|
"confirm": "Confirm",
|
||||||
"logOutTips": "Do you want to log out?"
|
"logOutTips": "Do you want to log out?"
|
||||||
},
|
},
|
||||||
|
"uiMsg": {
|
||||||
|
"titlePrompt": "Prompt",
|
||||||
|
"titleDelete": "Delete",
|
||||||
|
"titleDeleteSelected": "Delete selected",
|
||||||
|
"btnOk": "Confirm",
|
||||||
|
"btnCancel": "Cancel",
|
||||||
|
"deleteConfirmSingle": "Are you sure you want to delete this item?",
|
||||||
|
"deleteConfirmSelected": "Are you sure you want to delete the selected {n} items?",
|
||||||
|
"deleteSuccess": "Deleted",
|
||||||
|
"operationSuccess": "Success",
|
||||||
|
"selectRowsToDelete": "Please select rows to delete",
|
||||||
|
"selectAtLeastOne": "Please select at least one item",
|
||||||
|
"clearCacheSuccess": "Cache cleared",
|
||||||
|
"copySuccess": "Copied",
|
||||||
|
"copyFail": "Copy failed, please copy manually",
|
||||||
|
"uploadSuccess": "Uploaded",
|
||||||
|
"uploadFail": "Upload failed",
|
||||||
|
"downloadTemplateFail": "Failed to download template",
|
||||||
|
"importSuccess": "Imported",
|
||||||
|
"importFail": "Import failed",
|
||||||
|
"exportFail": "Export failed",
|
||||||
|
"exportSuccess": "Exported"
|
||||||
|
,
|
||||||
|
"exportNotConfigured": "Export API is not configured",
|
||||||
|
"exportPromptFileName": "Please enter export file name",
|
||||||
|
"exportFileNameRequired": "File name is required",
|
||||||
|
"clearCacheSelect": "Please select a cache to clear",
|
||||||
|
"clearCacheTitle": "Clear selected cache",
|
||||||
|
"clearCacheConfirmByTag": "Are you sure you want to clear cache for tag: {tag}?"
|
||||||
|
,
|
||||||
|
"saipackageWebBuildTitle": "Frontend build & publish",
|
||||||
|
"saipackageWebBuildConfirm": "Rebuild frontend and publish the project?",
|
||||||
|
"saipackageWebBuildSuccess": "Frontend built and published",
|
||||||
|
"saipackageFrontendDepsTitle": "Frontend dependencies",
|
||||||
|
"saipackageFrontendDepsConfirm": "Update frontend Node dependencies?",
|
||||||
|
"saipackageFrontendDepsSuccess": "Frontend dependencies updated",
|
||||||
|
"saipackageComposerTitle": "Composer dependencies",
|
||||||
|
"saipackageComposerConfirm": "Update backend Composer packages?",
|
||||||
|
"saipackageComposerSuccess": "Composer packages updated"
|
||||||
|
},
|
||||||
"form": {
|
"form": {
|
||||||
"placeholderInput": "Please enter",
|
"placeholderInput": "Please enter",
|
||||||
"placeholderSelect": "Please select",
|
"placeholderSelect": "Please select",
|
||||||
@@ -361,6 +401,7 @@
|
|||||||
"dice": {
|
"dice": {
|
||||||
"title": "Dice Game",
|
"title": "Dice Game",
|
||||||
"lotteryPoolConfig": "Lottery Tier Weight Config",
|
"lotteryPoolConfig": "Lottery Tier Weight Config",
|
||||||
|
"anteConfig": "Ante Config",
|
||||||
"player": "Player Management",
|
"player": "Player Management",
|
||||||
"playerWalletRecord": "Player Wallet Records",
|
"playerWalletRecord": "Player Wallet Records",
|
||||||
"playRecord": "Player Draw Records",
|
"playRecord": "Player Draw Records",
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
"poolName": "Pool Name",
|
"poolName": "Pool Name",
|
||||||
"playerProfit": "Player Total Profit (profit_amount):",
|
"playerProfit": "Player Total Profit (profit_amount):",
|
||||||
"realtime": "Live",
|
"realtime": "Live",
|
||||||
"profitCalcHint": "Profit per round: paid = win_coin (incl. BIGWIN) - paid_amount (= ante×100); free = win_coin. Refreshes every 2s while open.",
|
"profitCalcHint": "Profit per round: paid = win_coin (incl. BIGWIN) - paid_amount (= ante×1); free = win_coin. Refreshes every 2s while open.",
|
||||||
"tierRuleTitle": "Tier Rule",
|
"tierRuleTitle": "Tier Rule",
|
||||||
"tierRuleContent": "When player profit in this pool is below safety line, use player T*_weight; when above or equal, use pool T*_weight (kill).",
|
"tierRuleContent": "When player profit in this pool is below safety line, use player T*_weight; when above or equal, use pool T*_weight (kill).",
|
||||||
"killScoreWeights": "Kill weights",
|
"killScoreWeights": "Kill weights",
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
"rollArrayHint": "5 numbers, each 1–6",
|
"rollArrayHint": "5 numbers, each 1–6",
|
||||||
"rollNumber": "Roll Sum",
|
"rollNumber": "Roll Sum",
|
||||||
"placeholderRollNumber": "Sum of 5 dice (5–30)",
|
"placeholderRollNumber": "Sum of 5 dice (5–30)",
|
||||||
"rewardConfig": "Reward Config",
|
"rewardTier": "Reward Tier",
|
||||||
"placeholderRewardConfig": "Select reward config (by UI text)",
|
"placeholderRewardTier": "Select reward tier",
|
||||||
"addSuccess": "Added successfully",
|
"addSuccess": "Added successfully",
|
||||||
"editSuccess": "Updated successfully",
|
"editSuccess": "Updated successfully",
|
||||||
"validateFailed": "Validation failed, please check required fields and format"
|
"validateFailed": "Validation failed, please check required fields and format"
|
||||||
@@ -47,8 +47,8 @@
|
|||||||
"direction": "Direction",
|
"direction": "Direction",
|
||||||
"winCoin": "Win Coin",
|
"winCoin": "Win Coin",
|
||||||
"rollNumber": "Roll Number",
|
"rollNumber": "Roll Number",
|
||||||
"rewardConfig": "Reward Config",
|
|
||||||
"rewardTier": "Reward Tier",
|
"rewardTier": "Reward Tier",
|
||||||
|
"rewardConfig": "Reward Config",
|
||||||
"usernameFuzzy": "Username (fuzzy)",
|
"usernameFuzzy": "Username (fuzzy)",
|
||||||
"nameFuzzy": "Name (fuzzy)",
|
"nameFuzzy": "Name (fuzzy)",
|
||||||
"uiTextFuzzy": "UI Text (fuzzy)",
|
"uiTextFuzzy": "UI Text (fuzzy)",
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
"targetIndex": "Target Index",
|
"targetIndex": "Target Index",
|
||||||
"rollArray": "Roll Array",
|
"rollArray": "Roll Array",
|
||||||
"rollNumber": "Roll Number",
|
"rollNumber": "Roll Number",
|
||||||
"rewardConfig": "Reward Config",
|
"rewardTier": "Reward Tier",
|
||||||
"createTime": "Create Time",
|
"createTime": "Create Time",
|
||||||
"updateTime": "Update Time"
|
"updateTime": "Update Time"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
"targetIndex": "Target Index",
|
"targetIndex": "Target Index",
|
||||||
"rollArray": "Roll Array",
|
"rollArray": "Roll Array",
|
||||||
"rollNumber": "Roll Number",
|
"rollNumber": "Roll Number",
|
||||||
"rewardConfig": "Reward Config",
|
"rewardTier": "Reward Tier",
|
||||||
|
"status": "Status",
|
||||||
"createTime": "Create Time"
|
"createTime": "Create Time"
|
||||||
},
|
},
|
||||||
"form": {
|
"form": {
|
||||||
@@ -46,9 +47,7 @@
|
|||||||
"labelLotteryConfigId": "Lottery Config ID",
|
"labelLotteryConfigId": "Lottery Config ID",
|
||||||
"placeholderLotteryConfigId": "Please enter lottery config id",
|
"placeholderLotteryConfigId": "Please enter lottery config id",
|
||||||
"placeholderWinCoin": "Win coin",
|
"placeholderWinCoin": "Win coin",
|
||||||
"placeholderRewardTier": "Please select tier (will auto fill reward config id)",
|
"placeholderRewardTier": "Please select reward tier",
|
||||||
"rewardConfigId": "Reward Config ID",
|
|
||||||
"placeholderRewardConfigId": "Auto fill by tier or enter manually",
|
|
||||||
"placeholderStartIndex": "Please enter start index",
|
"placeholderStartIndex": "Please enter start index",
|
||||||
"labelTargetIndex": "Target Index",
|
"labelTargetIndex": "Target Index",
|
||||||
"placeholderTargetIndex": "Please enter target index",
|
"placeholderTargetIndex": "Please enter target index",
|
||||||
@@ -64,9 +63,14 @@
|
|||||||
"ruleDrawTypeRequired": "Draw type is required",
|
"ruleDrawTypeRequired": "Draw type is required",
|
||||||
"ruleIsBigWinRequired": "Is big win is required",
|
"ruleIsBigWinRequired": "Is big win is required",
|
||||||
"ruleDirectionRequired": "Direction is required",
|
"ruleDirectionRequired": "Direction is required",
|
||||||
"ruleRewardConfigIdRequired": "Reward config id is required",
|
"ruleRewardTierRequired": "Reward tier is required",
|
||||||
"ruleStatusRequired": "Status is required",
|
"ruleStatusRequired": "Status is required",
|
||||||
"addSuccess": "Added successfully",
|
"addSuccess": "Added successfully",
|
||||||
"editSuccess": "Updated successfully"
|
"editSuccess": "Updated successfully"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"clearAllConfirm": "Are you sure you want to clear all player draw test data?",
|
||||||
|
"clearAllSuccess": "All test data cleared",
|
||||||
|
"clearAllFail": "Clear failed"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@
|
|||||||
"status": "Status",
|
"status": "Status",
|
||||||
"coin": "Coin",
|
"coin": "Coin",
|
||||||
"lotteryPoolConfig": "Lottery Pool Config",
|
"lotteryPoolConfig": "Lottery Pool Config",
|
||||||
|
"customConfig": "Custom",
|
||||||
"t1Weight": "T1 Weight",
|
"t1Weight": "T1 Weight",
|
||||||
"t2Weight": "T2 Weight",
|
"t2Weight": "T2 Weight",
|
||||||
"t3Weight": "T3 Weight",
|
"t3Weight": "T3 Weight",
|
||||||
|
|||||||
@@ -56,7 +56,14 @@
|
|||||||
"weightTest": {
|
"weightTest": {
|
||||||
"title": "One-Click Weight Test",
|
"title": "One-Click Weight Test",
|
||||||
"alertTitle": "Bonus pool logic",
|
"alertTitle": "Bonus pool logic",
|
||||||
"alertBody": "Same as playStart draw: uses name=default safety line and kill switch; when profit is below the line, paid tickets use player tier weights (custom below), free tickets use killScore; when profit reaches the line and kill is on, both use killScore.",
|
"alertBody": "Test mode is non-kill by default. You can enable kill mode below with switch + safety line: once simulated player cumulative profit reaches the line, paid draws switch to killScore.",
|
||||||
|
"chainModeHint": "Simulation: set paid spin counts only (CW/CCW). If a paid draw hits “play again” (or T5), the next draw is free with the same ante, lottery type free, paid amount 0. Free-draw tier odds are configured below (including chained free plays).",
|
||||||
|
"killModeHint": "When test kill mode is enabled: use simulated player cumulative profit as trigger; once cumulative profit >= safety line, subsequent paid draws use killScore. Free draws still follow the configured free settings.",
|
||||||
|
"labelKillModeEnabled": "Enable test kill mode",
|
||||||
|
"labelTestSafetyLine": "Test safety line",
|
||||||
|
"sectionPaid": "Paid draws",
|
||||||
|
"sectionFreeAfterPlayAgain": "Free draw tier odds (after play-again)",
|
||||||
|
"tierProbHintFreeChain": "When using custom tier odds: T1–T5 below apply when a free draw runs (tier roll; combined with dice_reward row weights).",
|
||||||
"stepPaid": "Paid ticket",
|
"stepPaid": "Paid ticket",
|
||||||
"stepFree": "Free ticket",
|
"stepFree": "Free ticket",
|
||||||
"labelLotteryTypePaid": "Test pool type",
|
"labelLotteryTypePaid": "Test pool type",
|
||||||
@@ -75,6 +82,8 @@
|
|||||||
"btnStart": "Start test",
|
"btnStart": "Start test",
|
||||||
"btnCancel": "Cancel",
|
"btnCancel": "Cancel",
|
||||||
"warnAnte": "Ante must be greater than 0",
|
"warnAnte": "Ante must be greater than 0",
|
||||||
|
"warnPaidSpins": "Paid clockwise + counter-clockwise spin counts must be greater than 0",
|
||||||
|
"warnTestSafetyLine": "Test safety line must be greater than or equal to 0",
|
||||||
"warnTotalSpins": "At least one of paid/free direction spin counts must be greater than 0",
|
"warnTotalSpins": "At least one of paid/free direction spin counts must be greater than 0",
|
||||||
"warnPaidTierSumPositive": "When no paid pool is selected, T1–T5 odds sum must be greater than 0",
|
"warnPaidTierSumPositive": "When no paid pool is selected, T1–T5 odds sum must be greater than 0",
|
||||||
"warnPaidTierSumMax": "Paid T1–T5 odds sum cannot exceed 100%",
|
"warnPaidTierSumMax": "Paid T1–T5 odds sum cannot exceed 100%",
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"colDisplayText": "Display Text",
|
"colDisplayText": "Display Text",
|
||||||
"colDisplayTextEn": "Display Text (EN)",
|
"colDisplayTextEn": "Display Text (EN)",
|
||||||
"colRealEv": "Real Settlement",
|
"colRealEv": "Real Settlement",
|
||||||
|
"colRealReward": "Player Real Reward",
|
||||||
"colTier": "Tier",
|
"colTier": "Tier",
|
||||||
"colRemark": "Remark",
|
"colRemark": "Remark",
|
||||||
"placeholderTierSelect": "Tier",
|
"placeholderTierSelect": "Tier",
|
||||||
@@ -53,7 +54,7 @@
|
|||||||
"infoNoBigwin": "No BIGWIN rows. Set tier to BIGWIN in the Reward Index tab first.",
|
"infoNoBigwin": "No BIGWIN rows. Set tier to BIGWIN in the Reward Index tab first.",
|
||||||
"btnRuleGenerate": "Generate by rules",
|
"btnRuleGenerate": "Generate by rules",
|
||||||
"ruleGenerateTitle": "Generate reward index by rules",
|
"ruleGenerateTitle": "Generate reward index by rules",
|
||||||
"ruleGenerateRules": "[Generation logic (same as Create Reward Reference)]\n• 26 cells ordered by id ascending are positions 0–25; each row’s grid_number is 5–30 and unique.\n• Roll D (5–30): start at the cell whose grid_number equals D (start_index); clockwise landing = (start position + D) mod 26; counter-clockwise = start − D (if negative, +26).\n• Each reference row’s “dice points” column is the roll D; tier / real_ev / display text come from the config at the landing id.\n\n[Leopard rolls]\nFor rolls 5, 10, 15, 20, 25, 30, clockwise and counter-clockwise landing tiers must NOT be T4 or T5 (avoid leopard roll + penalty / try again).\n\n[real_ev vs tier]\nreal < −100 → T4; −100 < real < 0 → T3; 0 < real < 100 → T2; 100 < real < 500 → T1; T5 “try again” real_ev=0. Set per-tier real_ev standards below; values are written into the config and can be edited later.\n\n[Inputs]\nT1/T4/T5: fixed weighted counts. T2: minimum weighted count — clockwise and counter-clockwise must satisfy the corresponding constraints (one value per tier, applied to both directions). real_ev standards: one value per tier. Generated T1–T4 use ui_text / ui_text_en = 100 + real_ev (same EN); T5 uses “try again” / “Once again”. Remarks still distinguish break-even vs small win where applicable.",
|
"ruleGenerateRules": "[Generation logic (same as Create Reward Reference)]\n• 26 cells ordered by id ascending are positions 0–25; each row’s grid_number is 5–30 and unique.\n• Roll D (5–30): start at the cell whose grid_number equals D (start_index); clockwise landing = (start position + D) mod 26; counter-clockwise = start − D (if negative, +26).\n• Each reference row’s “dice points” column is the roll D; tier / real_ev / display text come from the config at the landing id.\n\n[Leopard rolls]\nFor rolls 5, 10, 15, 20, 25, 30, clockwise and counter-clockwise landing tiers must NOT be T4 or T5 (avoid leopard roll + penalty / once again).\n\n[Settlement amount vs tier]\nSettlement < 0 → T4; 0 < Settlement < 100 → T3; 100 < Settlement < 200 → T2; Settlement > 200 → T1; T5 “once again” settlement = 0. You can set a unified settlement standard for each tier below; generated rows write those values into the config, and details can be edited later in the table.\n\n[Inputs in this dialog]\nCount: T1/T4/T5 are fixed; T2 is minimum. Clockwise and counter-clockwise weighted counts (each roll result counts once) must each satisfy the entered values; T1, T4, and T5 are entered separately.\nSettlement standard: all cells in the same tier use the same value. On generation, T1–T4 use ui_text / ui_text_en = settlement real_ev; T5 is fixed to \"再来一次\" / \"Once again\". Remarks still distinguish break-even / small win, etc.",
|
||||||
"ruleGenT1Row": "T1 (big prize)",
|
"ruleGenT1Row": "T1 (big prize)",
|
||||||
"ruleGenT2Row": "T2 (small win / break-even)",
|
"ruleGenT2Row": "T2 (small win / break-even)",
|
||||||
"ruleGenT3RealEvOnly": "T3 (rake)",
|
"ruleGenT3RealEvOnly": "T3 (rake)",
|
||||||
@@ -63,10 +64,10 @@
|
|||||||
"ruleGenFixedCount": "Fixed count (CW & CCW)",
|
"ruleGenFixedCount": "Fixed count (CW & CCW)",
|
||||||
"ruleGenRealEvStd": "real_ev standard",
|
"ruleGenRealEvStd": "real_ev standard",
|
||||||
"ruleGenRealEvEditHint": "After saving, you can still edit display text, EN, real_ev and remarks per row in the table above.",
|
"ruleGenRealEvEditHint": "After saving, you can still edit display text, EN, real_ev and remarks per row in the table above.",
|
||||||
"ruleGenInvalidT1RealEv": "T1 real_ev must satisfy 100 < value < 500",
|
"ruleGenInvalidT1RealEv": "T1 settlement amount must satisfy: value > 200",
|
||||||
"ruleGenInvalidT2RealEv": "T2 real_ev must satisfy 0 < value < 100",
|
"ruleGenInvalidT2RealEv": "T2 settlement amount must satisfy: 100 < value < 200",
|
||||||
"ruleGenInvalidT3RealEv": "T3 real_ev must satisfy -100 < value < 0",
|
"ruleGenInvalidT3RealEv": "T3 settlement amount must satisfy: 0 < value < 100",
|
||||||
"ruleGenInvalidT4RealEv": "T4 real_ev must satisfy value < -100",
|
"ruleGenInvalidT4RealEv": "T4 settlement amount must satisfy: value < 0",
|
||||||
"ruleGenInvalidT5RealEv": "T5 “try again” real_ev must be 0",
|
"ruleGenInvalidT5RealEv": "T5 “try again” real_ev must be 0",
|
||||||
"ruleGenT1Min": "T1 fixed count (CW & CCW)",
|
"ruleGenT1Min": "T1 fixed count (CW & CCW)",
|
||||||
"ruleGenT2Min": "T2 min (CW & CCW)",
|
"ruleGenT2Min": "T2 min (CW & CCW)",
|
||||||
|
|||||||
@@ -2,15 +2,26 @@
|
|||||||
"toolbar": {
|
"toolbar": {
|
||||||
"viewDetail": "View Detail"
|
"viewDetail": "View Detail"
|
||||||
},
|
},
|
||||||
|
"search": {
|
||||||
|
"paidPlannedSpins": "Planned paid spins",
|
||||||
|
"ante": "Ante"
|
||||||
|
},
|
||||||
"table": {
|
"table": {
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
"clockwiseAbbr": "CW",
|
"clockwiseAbbr": "CW",
|
||||||
"counterclockwiseAbbr": "CCW",
|
"counterclockwiseAbbr": "CCW",
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"paidDraw": "Paid Draw",
|
"paidDraw": "Paid Draw",
|
||||||
"freeDraw": "Free Draw",
|
"chainMode": "Chain play-again",
|
||||||
|
"chainModeYes": "Yes",
|
||||||
|
"chainModeNo": "No",
|
||||||
|
"paidPlannedSpins": "Planned paid spins",
|
||||||
|
"ante": "Ante",
|
||||||
|
"playAgainCount": "Play-again count",
|
||||||
|
"progressDraws": "{over} done",
|
||||||
|
"progressFailed": "{over} before fail",
|
||||||
"platformProfit": "Platform Profit",
|
"platformProfit": "Platform Profit",
|
||||||
"totalDrawCount": "Total Draw Count",
|
"totalDrawCount": "Total draws",
|
||||||
"createdBy": "Created By",
|
"createdBy": "Created By",
|
||||||
"remark": "Remark",
|
"remark": "Remark",
|
||||||
"createTime": "Create Time",
|
"createTime": "Create Time",
|
||||||
@@ -37,6 +48,10 @@
|
|||||||
"recordId": "Record ID",
|
"recordId": "Record ID",
|
||||||
"testCount": "Test count",
|
"testCount": "Test count",
|
||||||
"testCountSuffix": " runs",
|
"testCountSuffix": " runs",
|
||||||
|
"testCountProgress": "In progress: {over} done",
|
||||||
|
"testCountFailed": "{over} before failure",
|
||||||
|
"chainModeLabel": "Chain play-again",
|
||||||
|
"paidPlannedSpins": "Planned paid spins",
|
||||||
"createTime": "Created at",
|
"createTime": "Created at",
|
||||||
"admin": "Operator",
|
"admin": "Operator",
|
||||||
"paidPoolId": "Paid lottery pool config ID",
|
"paidPoolId": "Paid lottery pool config ID",
|
||||||
|
|||||||
@@ -47,5 +47,11 @@
|
|||||||
"ruleRoleRequired": "Please select role",
|
"ruleRoleRequired": "Please select role",
|
||||||
"addSuccess": "Added successfully",
|
"addSuccess": "Added successfully",
|
||||||
"editSuccess": "Updated successfully"
|
"editSuccess": "Updated successfully"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"promptNewPassword": "Please enter a new password",
|
||||||
|
"passwordLengthError": "Password length must be between 6 and 16",
|
||||||
|
"passwordChanged": "Password updated",
|
||||||
|
"clearCacheConfirm": "Are you sure you want to clear cache?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,5 +16,16 @@
|
|||||||
"tplCategory": "Gen Type",
|
"tplCategory": "Gen Type",
|
||||||
"updateTime": "Update Time",
|
"updateTime": "Update Time",
|
||||||
"createTime": "Create Time"
|
"createTime": "Create Time"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"generating": "Generating code package, please wait...",
|
||||||
|
"generateSuccess": "Code generated, downloading...",
|
||||||
|
"downloadFail": "Download failed",
|
||||||
|
"syncConfirm": "Sync will overwrite the configured table structure. Continue?",
|
||||||
|
"syncSuccess": "Synced",
|
||||||
|
"generateToProjectConfirm": "Generate-to-project will overwrite existing files. Continue?",
|
||||||
|
"generateToProjectSuccess": "Generated to project",
|
||||||
|
"loadSuccess": "Loaded",
|
||||||
|
"copyToClipboard": "Code copied to clipboard"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,5 +58,11 @@
|
|||||||
"ruleTargetRequired": "Target is required",
|
"ruleTargetRequired": "Target is required",
|
||||||
"addSuccess": "Added successfully",
|
"addSuccess": "Added successfully",
|
||||||
"editSuccess": "Updated successfully"
|
"editSuccess": "Updated successfully"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"runTitle": "Run Task",
|
||||||
|
"runConfirm": "Are you sure you want to run task [{name}]?",
|
||||||
|
"runSuccess": "Task started",
|
||||||
|
"selectTaskFirst": "Please select a task first"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,46 @@
|
|||||||
"confirm": "确定",
|
"confirm": "确定",
|
||||||
"logOutTips": "您是否要退出登录?"
|
"logOutTips": "您是否要退出登录?"
|
||||||
},
|
},
|
||||||
|
"uiMsg": {
|
||||||
|
"titlePrompt": "提示",
|
||||||
|
"titleDelete": "删除数据",
|
||||||
|
"titleDeleteSelected": "删除选中数据",
|
||||||
|
"btnOk": "确定",
|
||||||
|
"btnCancel": "取消",
|
||||||
|
"deleteConfirmSingle": "确定要删除该数据吗?",
|
||||||
|
"deleteConfirmSelected": "确定要删除选中的 {n} 条数据吗?",
|
||||||
|
"deleteSuccess": "删除成功",
|
||||||
|
"operationSuccess": "操作成功",
|
||||||
|
"selectRowsToDelete": "请选择要删除的行",
|
||||||
|
"selectAtLeastOne": "至少要选择一条数据",
|
||||||
|
"clearCacheSuccess": "清理缓存成功",
|
||||||
|
"copySuccess": "复制成功",
|
||||||
|
"copyFail": "复制失败,请手动复制",
|
||||||
|
"uploadSuccess": "上传成功",
|
||||||
|
"uploadFail": "上传失败",
|
||||||
|
"downloadTemplateFail": "下载模板失败",
|
||||||
|
"importSuccess": "导入成功",
|
||||||
|
"importFail": "导入失败",
|
||||||
|
"exportFail": "导出失败",
|
||||||
|
"exportSuccess": "导出成功"
|
||||||
|
,
|
||||||
|
"exportNotConfigured": "未配置导出接口",
|
||||||
|
"exportPromptFileName": "请输入导出文件名称",
|
||||||
|
"exportFileNameRequired": "文件名不能为空",
|
||||||
|
"clearCacheSelect": "请选择要清理的缓存",
|
||||||
|
"clearCacheTitle": "清理选中缓存",
|
||||||
|
"clearCacheConfirmByTag": "确定要清理标签:【{tag}】的缓存吗?"
|
||||||
|
,
|
||||||
|
"saipackageWebBuildTitle": "前端打包发布",
|
||||||
|
"saipackageWebBuildConfirm": "确认重新打包前端并发布项目吗?",
|
||||||
|
"saipackageWebBuildSuccess": "前端打包发布成功",
|
||||||
|
"saipackageFrontendDepsTitle": "前端依赖更新",
|
||||||
|
"saipackageFrontendDepsConfirm": "确认更新前端Node依赖吗?",
|
||||||
|
"saipackageFrontendDepsSuccess": "前端依赖更新成功",
|
||||||
|
"saipackageComposerTitle": "composer包更新",
|
||||||
|
"saipackageComposerConfirm": "确认更新后端composer包吗?",
|
||||||
|
"saipackageComposerSuccess": "composer包更新成功"
|
||||||
|
},
|
||||||
"form": {
|
"form": {
|
||||||
"placeholderInput": "请输入",
|
"placeholderInput": "请输入",
|
||||||
"placeholderSelect": "请选择",
|
"placeholderSelect": "请选择",
|
||||||
@@ -357,6 +397,7 @@
|
|||||||
"dice": {
|
"dice": {
|
||||||
"title": "大富翁-色子游戏",
|
"title": "大富翁-色子游戏",
|
||||||
"lotteryPoolConfig": "彩金池配置",
|
"lotteryPoolConfig": "彩金池配置",
|
||||||
|
"anteConfig": "底注配置",
|
||||||
"player": "玩家管理",
|
"player": "玩家管理",
|
||||||
"playerWalletRecord": "玩家钱包记录",
|
"playerWalletRecord": "玩家钱包记录",
|
||||||
"playRecord": "玩家抽奖记录",
|
"playRecord": "玩家抽奖记录",
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
"poolName": "池子名称",
|
"poolName": "池子名称",
|
||||||
"playerProfit": "玩家累计盈利(profit_amount):",
|
"playerProfit": "玩家累计盈利(profit_amount):",
|
||||||
"realtime": "实时",
|
"realtime": "实时",
|
||||||
"profitCalcHint": "计算方式:付费每局按“赢取平台币 win_coin(含 BIGWIN)减去付费金额 压注金额paid_amount(= 压注倍数ante×100)”累加;免费每局按“玩家赢得平台币win_coin”累加。弹窗打开期间每 2 秒自动刷新",
|
"profitCalcHint": "计算方式:付费每局按“赢取平台币 win_coin(含 BIGWIN)减去付费金额 压注金额paid_amount(= 压注倍数ante×1)”累加;免费每局按“玩家赢得平台币win_coin”累加。弹窗打开期间每 2 秒自动刷新",
|
||||||
"tierRuleTitle": "抽奖档位规则",
|
"tierRuleTitle": "抽奖档位规则",
|
||||||
"tierRuleContent": "当玩家在当前彩金池的累计盈利 低于安全线 时,按 玩家 的 T*_weight 权重抽取档位;当累计盈利 高于或等于安全线 时,按 当前彩金池 的 T*_weight 权重抽取档位(杀分)。",
|
"tierRuleContent": "当玩家在当前彩金池的累计盈利 低于安全线 时,按 玩家 的 T*_weight 权重抽取档位;当累计盈利 高于或等于安全线 时,按 当前彩金池 的 T*_weight 权重抽取档位(杀分)。",
|
||||||
"killScoreWeights": "杀分权重",
|
"killScoreWeights": "杀分权重",
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
"rollArrayHint": "固定 5 个数,每个 1~6",
|
"rollArrayHint": "固定 5 个数,每个 1~6",
|
||||||
"rollNumber": "摇取点数和",
|
"rollNumber": "摇取点数和",
|
||||||
"placeholderRollNumber": "5 个色子点数之和(5~30)",
|
"placeholderRollNumber": "5 个色子点数之和(5~30)",
|
||||||
"rewardConfig": "奖励配置",
|
"rewardTier": "中奖档位",
|
||||||
"placeholderRewardConfig": "请选择奖励配置(显示前端文本)",
|
"placeholderRewardTier": "请选择中奖档位",
|
||||||
"addSuccess": "新增成功",
|
"addSuccess": "新增成功",
|
||||||
"editSuccess": "修改成功",
|
"editSuccess": "修改成功",
|
||||||
"validateFailed": "表单验证失败,请检查必填项与格式"
|
"validateFailed": "表单验证失败,请检查必填项与格式"
|
||||||
@@ -47,8 +47,8 @@
|
|||||||
"direction": "方向",
|
"direction": "方向",
|
||||||
"winCoin": "赢取平台币",
|
"winCoin": "赢取平台币",
|
||||||
"rollNumber": "摇取点数和",
|
"rollNumber": "摇取点数和",
|
||||||
|
"rewardTier": "中奖档位",
|
||||||
"rewardConfig": "奖励配置",
|
"rewardConfig": "奖励配置",
|
||||||
"rewardTier": "奖励档位",
|
|
||||||
"usernameFuzzy": "用户名模糊",
|
"usernameFuzzy": "用户名模糊",
|
||||||
"nameFuzzy": "名称模糊",
|
"nameFuzzy": "名称模糊",
|
||||||
"uiTextFuzzy": "前端显示文本模糊",
|
"uiTextFuzzy": "前端显示文本模糊",
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
"targetIndex": "终点索引",
|
"targetIndex": "终点索引",
|
||||||
"rollArray": "摇取点数",
|
"rollArray": "摇取点数",
|
||||||
"rollNumber": "摇取点数和",
|
"rollNumber": "摇取点数和",
|
||||||
"rewardConfig": "奖励配置",
|
"rewardTier": "中奖档位",
|
||||||
"createTime": "创建时间",
|
"createTime": "创建时间",
|
||||||
"updateTime": "更新时间"
|
"updateTime": "更新时间"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"winCoin": "赢取平台币",
|
"winCoin": "赢取平台币",
|
||||||
"paidAmount": "付费金额",
|
"paidAmount": "付费金额",
|
||||||
"ante": "底注",
|
"ante": "底注",
|
||||||
"rewardTier": "奖励档位",
|
"rewardTier": "中奖档位",
|
||||||
"rollNumber": "摇取点数和",
|
"rollNumber": "摇取点数和",
|
||||||
"paid": "付费",
|
"paid": "付费",
|
||||||
"free": "免费",
|
"free": "免费",
|
||||||
@@ -37,7 +37,8 @@
|
|||||||
"targetIndex": "终点索引",
|
"targetIndex": "终点索引",
|
||||||
"rollArray": "摇取点数",
|
"rollArray": "摇取点数",
|
||||||
"rollNumber": "摇取点数和",
|
"rollNumber": "摇取点数和",
|
||||||
"rewardConfig": "奖励配置",
|
"rewardTier": "中奖档位",
|
||||||
|
"status": "状态",
|
||||||
"createTime": "创建时间"
|
"createTime": "创建时间"
|
||||||
},
|
},
|
||||||
"form": {
|
"form": {
|
||||||
@@ -46,9 +47,7 @@
|
|||||||
"labelLotteryConfigId": "彩金池配置id",
|
"labelLotteryConfigId": "彩金池配置id",
|
||||||
"placeholderLotteryConfigId": "请输入彩金池配置id",
|
"placeholderLotteryConfigId": "请输入彩金池配置id",
|
||||||
"placeholderWinCoin": "赢取平台币",
|
"placeholderWinCoin": "赢取平台币",
|
||||||
"placeholderRewardTier": "请选择档位(选后自动带出奖励配置ID)",
|
"placeholderRewardTier": "请选择中奖档位",
|
||||||
"rewardConfigId": "奖励配置id",
|
|
||||||
"placeholderRewardConfigId": "可选中奖档位自动带出或手动输入",
|
|
||||||
"placeholderStartIndex": "请输入起始索引",
|
"placeholderStartIndex": "请输入起始索引",
|
||||||
"labelTargetIndex": "结束索引",
|
"labelTargetIndex": "结束索引",
|
||||||
"placeholderTargetIndex": "请输入结束索引",
|
"placeholderTargetIndex": "请输入结束索引",
|
||||||
@@ -64,9 +63,14 @@
|
|||||||
"ruleDrawTypeRequired": "抽奖类型必需填写",
|
"ruleDrawTypeRequired": "抽奖类型必需填写",
|
||||||
"ruleIsBigWinRequired": "是否中大奖必需填写",
|
"ruleIsBigWinRequired": "是否中大奖必需填写",
|
||||||
"ruleDirectionRequired": "方向必需填写",
|
"ruleDirectionRequired": "方向必需填写",
|
||||||
"ruleRewardConfigIdRequired": "奖励配置id必需填写",
|
"ruleRewardTierRequired": "中奖档位必需填写",
|
||||||
"ruleStatusRequired": "状态必需填写",
|
"ruleStatusRequired": "状态必需填写",
|
||||||
"addSuccess": "新增成功",
|
"addSuccess": "新增成功",
|
||||||
"editSuccess": "修改成功"
|
"editSuccess": "修改成功"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"clearAllConfirm": "确定清空所有玩家抽奖测试数据?",
|
||||||
|
"clearAllSuccess": "已清空所有测试数据",
|
||||||
|
"clearAllFail": "清空失败"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@
|
|||||||
"status": "状态",
|
"status": "状态",
|
||||||
"coin": "平台币",
|
"coin": "平台币",
|
||||||
"lotteryPoolConfig": "彩金池配置",
|
"lotteryPoolConfig": "彩金池配置",
|
||||||
|
"customConfig": "自定义",
|
||||||
"t1Weight": "T1权重",
|
"t1Weight": "T1权重",
|
||||||
"t2Weight": "T2权重",
|
"t2Weight": "T2权重",
|
||||||
"t3Weight": "T3权重",
|
"t3Weight": "T3权重",
|
||||||
|
|||||||
@@ -56,7 +56,14 @@
|
|||||||
"weightTest": {
|
"weightTest": {
|
||||||
"title": "一键测试权重",
|
"title": "一键测试权重",
|
||||||
"alertTitle": "彩金池逻辑说明",
|
"alertTitle": "彩金池逻辑说明",
|
||||||
"alertBody": "与 playStart 抽奖逻辑一致:使用 name=default 的安全线、杀分开关;盈利未达安全线时,付费抽奖券使用玩家自身权重(下方自定义档位),免费抽奖券使用 killScore 配置;盈利达到安全线且杀分开启时,付费/免费均使用 killScore 配置。",
|
"alertBody": "测试模式默认不启用杀分切换;可通过下方“杀分开关 + 安全线”在测试内启用:当模拟玩家累计盈利达到安全线后,付费抽奖切换到 killScore。",
|
||||||
|
"chainModeHint": "模拟方式:只配置付费抽奖次数(顺/逆时针)。付费抽到「再来一次」或 T5 时,下一局自动为免费抽奖,底注与触发局相同,抽奖类型记为免费、付费金额记为 0。免费抽奖的档位概率由下方「免费抽奖」配置决定(含通过再来一次触发的后续免费局)。",
|
||||||
|
"killModeHint": "杀分开关开启后:以“模拟玩家累计盈利”作为判定值;当累计盈利 >= 安全线时,后续付费抽奖按 killScore 配置抽取;免费抽奖仍按“免费抽奖配置”执行。",
|
||||||
|
"labelKillModeEnabled": "开启测试内杀分",
|
||||||
|
"labelTestSafetyLine": "测试安全线",
|
||||||
|
"sectionPaid": "付费抽奖",
|
||||||
|
"sectionFreeAfterPlayAgain": "免费抽奖(再来一次后的档位概率)",
|
||||||
|
"tierProbHintFreeChain": "当使用自定义档位时:以下为「免费抽奖」时 T1~T5 的档位概率(仅在有免费局时参与摇档,与 dice_reward 格子权重共同决定结果)。",
|
||||||
"stepPaid": "付费抽奖券",
|
"stepPaid": "付费抽奖券",
|
||||||
"stepFree": "免费抽奖券",
|
"stepFree": "免费抽奖券",
|
||||||
"labelLotteryTypePaid": "测试数据档位类型",
|
"labelLotteryTypePaid": "测试数据档位类型",
|
||||||
@@ -75,6 +82,8 @@
|
|||||||
"btnStart": "开始测试",
|
"btnStart": "开始测试",
|
||||||
"btnCancel": "取消",
|
"btnCancel": "取消",
|
||||||
"warnAnte": "底注 ante 必须大于 0",
|
"warnAnte": "底注 ante 必须大于 0",
|
||||||
|
"warnPaidSpins": "付费抽奖顺时针与逆时针次数之和须大于 0",
|
||||||
|
"warnTestSafetyLine": "测试安全线必须大于或等于 0",
|
||||||
"warnTotalSpins": "付费或免费至少一种方向次数之和大于 0",
|
"warnTotalSpins": "付费或免费至少一种方向次数之和大于 0",
|
||||||
"warnPaidTierSumPositive": "付费未选奖池时,T1~T5 档位概率之和需大于 0",
|
"warnPaidTierSumPositive": "付费未选奖池时,T1~T5 档位概率之和需大于 0",
|
||||||
"warnPaidTierSumMax": "付费档位概率 T1~T5 之和不能超过 100%",
|
"warnPaidTierSumMax": "付费档位概率 T1~T5 之和不能超过 100%",
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
"colDicePoints": "色子点数",
|
"colDicePoints": "色子点数",
|
||||||
"colDisplayText": "显示文本",
|
"colDisplayText": "显示文本",
|
||||||
"colDisplayTextEn": "显示文本(英文)",
|
"colDisplayTextEn": "显示文本(英文)",
|
||||||
"colRealEv": "真实结算",
|
"colRealEv": "结算金额",
|
||||||
|
"colRealReward": "玩家实际中奖",
|
||||||
"colTier": "所属档位",
|
"colTier": "所属档位",
|
||||||
"colRemark": "备注",
|
"colRemark": "备注",
|
||||||
"placeholderTierSelect": "档位",
|
"placeholderTierSelect": "档位",
|
||||||
@@ -53,7 +54,7 @@
|
|||||||
"infoNoBigwin": "暂无 BIGWIN 档位配置,请先在「奖励索引」中设置 tier 为 BIGWIN",
|
"infoNoBigwin": "暂无 BIGWIN 档位配置,请先在「奖励索引」中设置 tier 为 BIGWIN",
|
||||||
"btnRuleGenerate": "按规则生成",
|
"btnRuleGenerate": "按规则生成",
|
||||||
"ruleGenerateTitle": "按规则生成奖励索引",
|
"ruleGenerateTitle": "按规则生成奖励索引",
|
||||||
"ruleGenerateRules": "【生成逻辑(与创建奖励对照一致)】\n• 盘面 26 格按 id 升序为位置 0~25;每条配置的 grid_number 为 5~30 且不重复。\n• 摇取点数 D(5~30):起点为「grid_number=D」所在格位的 id(即 start_index),顺时针落点位置 = (起点位置 + D) mod 26,逆时针落点 = 起点位置 − D(若小于 0 则 +26)。\n• 对照表每条记录的「色子点数」列为摇取点数 D;档位、真实结算、显示文案取自落点格位对应 id 的配置。\n\n【豹子摇取点数】\n摇取点数为 5、10、15、20、25、30 时,其顺/逆时针落点档位不能为 T4、T5(避免对照表上出现豹子点数 + 惩罚/再来一次)。\n\n【real_ev 与 tier】\nreal < −100 → T4;−100 < real < 0 → T3;0 < real < 100 → T2;100 < real < 500 → T1;T5「再来一次」real_ev=0。下方可为各档位填写统一的 real_ev 标准,生成时写入配置;细则可稍后在表格中再改。\n\n【本弹窗输入】\n条数:T1/T4/T5「固定」;T2「不少于」——顺时针与逆时针的加权条数(每条摇取结果计一次)须分别满足所填数值;T1、T4 与 T5 分开填写。\nreal_ev 标准:同档位各格使用同一数值。生成时 T1~T4 的 ui_text / ui_text_en 均为「100+真实结算」;T5 固定为「再来一次」/「Once again」。备注仍区分完美回本/小赚等。",
|
"ruleGenerateRules": "【生成逻辑(与创建奖励对照一致)】\n• 盘面 26 格按 id 升序为位置 0~25;每条配置的 grid_number 为 5~30 且不重复。\n• 摇取点数 D(5~30):起点为「grid_number=D」所在格位的 id(即 start_index),顺时针落点位置 = (起点位置 + D) mod 26,逆时针落点 = 起点位置 − D(若小于 0 则 +26)。\n• 对照表每条记录的「色子点数」列为摇取点数 D;档位、真实结算、显示文案取自落点格位对应 id 的配置。\n\n【豹子摇取点数】\n摇取点数为 5、10、15、20、25、30 时,其顺/逆时针落点档位不能为 T4、T5(避免对照表上出现豹子点数 + 惩罚/再来一次)。\n\n【结算金额 与 档位】\n结算金额 < 0 → T4;0 < 结算金额 < 100 → T3;100 < 结算金额 < 200 → T2;200 < 结算金额 → T1;T5「再来一次」结算金额=0。下方可为各档位填写统一的 结算金额 标准,生成时写入配置;细则可稍后在表格中再改。\n\n【本弹窗输入】\n条数:T1/T4/T5「固定」;T2「不少于」——顺时针与逆时针的加权条数(每条摇取结果计一次)须分别满足所填数值;T1、T4 与 T5 分开填写。\n结算金额 标准:同档位各格使用同一数值。生成时 T1~T4 的 显示文本 / 显示文本(英文) = 结算金额;T5 固定为「再来一次」/「Once again」。备注仍区分完美回本/小赚等。",
|
||||||
"ruleGenT1Row": "T1 大奖",
|
"ruleGenT1Row": "T1 大奖",
|
||||||
"ruleGenT2Row": "T2 小赚/回本",
|
"ruleGenT2Row": "T2 小赚/回本",
|
||||||
"ruleGenT3RealEvOnly": "T3 抽水",
|
"ruleGenT3RealEvOnly": "T3 抽水",
|
||||||
@@ -61,13 +62,13 @@
|
|||||||
"ruleGenT5Row": "T5 再来一次",
|
"ruleGenT5Row": "T5 再来一次",
|
||||||
"ruleGenMinCount": "最少条数",
|
"ruleGenMinCount": "最少条数",
|
||||||
"ruleGenFixedCount": "固定条数(顺/逆)",
|
"ruleGenFixedCount": "固定条数(顺/逆)",
|
||||||
"ruleGenRealEvStd": "real_ev 标准",
|
"ruleGenRealEvStd": "结算金额",
|
||||||
"ruleGenRealEvEditHint": "生成并保存后,仍可在本页表格中逐条修改显示文案、英文、真实结算与备注。",
|
"ruleGenRealEvEditHint": "生成并保存后,仍可在本页表格中逐条修改显示文案、英文、真实结算与备注。",
|
||||||
"ruleGenInvalidT1RealEv": "T1 的 real_ev 须满足:100 < 值 < 500",
|
"ruleGenInvalidT1RealEv": "T1 的 结算金额 满足:200 < 值",
|
||||||
"ruleGenInvalidT2RealEv": "T2 的 real_ev 须满足:0 < 值 < 100",
|
"ruleGenInvalidT2RealEv": "T2 的 结算金额 满足:100 < 值 < 200",
|
||||||
"ruleGenInvalidT3RealEv": "T3 的 real_ev 须满足:-100 < 值 < 0",
|
"ruleGenInvalidT3RealEv": "T3 的 结算金额 满足:0 < 值 < 100",
|
||||||
"ruleGenInvalidT4RealEv": "T4 的 real_ev 须满足:值 < -100",
|
"ruleGenInvalidT4RealEv": "T4 的 结算金额 满足:值 < 0",
|
||||||
"ruleGenInvalidT5RealEv": "T5「再来一次」的 real_ev 须为 0",
|
"ruleGenInvalidT5RealEv": "T5「再来一次」的 结算金额 须为 0",
|
||||||
"ruleGenT1Min": "T1 固定条数(顺/逆)",
|
"ruleGenT1Min": "T1 固定条数(顺/逆)",
|
||||||
"ruleGenT2Min": "T2 最少条数(顺/逆)",
|
"ruleGenT2Min": "T2 最少条数(顺/逆)",
|
||||||
"ruleGenT4Max": "T4 固定条数(顺/逆)",
|
"ruleGenT4Max": "T4 固定条数(顺/逆)",
|
||||||
|
|||||||
@@ -2,13 +2,24 @@
|
|||||||
"toolbar": {
|
"toolbar": {
|
||||||
"viewDetail": "查看详情"
|
"viewDetail": "查看详情"
|
||||||
},
|
},
|
||||||
|
"search": {
|
||||||
|
"paidPlannedSpins": "计划付费次数",
|
||||||
|
"ante": "底注"
|
||||||
|
},
|
||||||
"table": {
|
"table": {
|
||||||
"id": "ID",
|
"id": "ID",
|
||||||
"clockwiseAbbr": "顺",
|
"clockwiseAbbr": "顺",
|
||||||
"counterclockwiseAbbr": "逆",
|
"counterclockwiseAbbr": "逆",
|
||||||
"status": "状态",
|
"status": "状态",
|
||||||
"paidDraw": "付费抽取",
|
"paidDraw": "付费抽取",
|
||||||
"freeDraw": "免费抽取",
|
"chainMode": "链式再来一次",
|
||||||
|
"chainModeYes": "是",
|
||||||
|
"chainModeNo": "否",
|
||||||
|
"paidPlannedSpins": "计划付费次数",
|
||||||
|
"ante": "底注",
|
||||||
|
"playAgainCount": "再来一次次数",
|
||||||
|
"progressDraws": "已完成 {over} 次",
|
||||||
|
"progressFailed": "失败前 {over} 次",
|
||||||
"platformProfit": "平台赚取金额",
|
"platformProfit": "平台赚取金额",
|
||||||
"totalDrawCount": "总抽奖次数",
|
"totalDrawCount": "总抽奖次数",
|
||||||
"createdBy": "创建管理员",
|
"createdBy": "创建管理员",
|
||||||
@@ -37,6 +48,10 @@
|
|||||||
"recordId": "记录ID",
|
"recordId": "记录ID",
|
||||||
"testCount": "测试次数",
|
"testCount": "测试次数",
|
||||||
"testCountSuffix": "次",
|
"testCountSuffix": "次",
|
||||||
|
"testCountProgress": "进行中:已完成 {over} 次",
|
||||||
|
"testCountFailed": "失败前 {over} 次",
|
||||||
|
"chainModeLabel": "链式再来一次",
|
||||||
|
"paidPlannedSpins": "计划付费次数",
|
||||||
"createTime": "创建时间",
|
"createTime": "创建时间",
|
||||||
"admin": "执行管理员",
|
"admin": "执行管理员",
|
||||||
"paidPoolId": "付费奖池配置ID",
|
"paidPoolId": "付费奖池配置ID",
|
||||||
|
|||||||
@@ -47,5 +47,11 @@
|
|||||||
"ruleRoleRequired": "请选择角色",
|
"ruleRoleRequired": "请选择角色",
|
||||||
"addSuccess": "新增成功",
|
"addSuccess": "新增成功",
|
||||||
"editSuccess": "修改成功"
|
"editSuccess": "修改成功"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"promptNewPassword": "请输入新密码",
|
||||||
|
"passwordLengthError": "密码长度在6到16之间",
|
||||||
|
"passwordChanged": "修改密码成功",
|
||||||
|
"clearCacheConfirm": "确定要清理缓存吗?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,5 +16,16 @@
|
|||||||
"tplCategory": "生成类型",
|
"tplCategory": "生成类型",
|
||||||
"updateTime": "更新时间",
|
"updateTime": "更新时间",
|
||||||
"createTime": "创建时间"
|
"createTime": "创建时间"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"generating": "代码生成下载中,请稍后",
|
||||||
|
"generateSuccess": "代码生成成功,开始下载",
|
||||||
|
"downloadFail": "文件下载失败",
|
||||||
|
"syncConfirm": "执行同步操作将会覆盖已经设置的表结构,确定要同步吗?",
|
||||||
|
"syncSuccess": "同步成功",
|
||||||
|
"generateToProjectConfirm": "生成到项目将会覆盖原有文件,确定要生成吗?",
|
||||||
|
"generateToProjectSuccess": "生成到项目成功",
|
||||||
|
"loadSuccess": "装载成功",
|
||||||
|
"copyToClipboard": "代码已复制到剪贴板"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,5 +58,11 @@
|
|||||||
"ruleTargetRequired": "调用目标不能为空",
|
"ruleTargetRequired": "调用目标不能为空",
|
||||||
"addSuccess": "新增成功",
|
"addSuccess": "新增成功",
|
||||||
"editSuccess": "修改成功"
|
"editSuccess": "修改成功"
|
||||||
|
},
|
||||||
|
"ui": {
|
||||||
|
"runTitle": "运行任务",
|
||||||
|
"runConfirm": "确定要运行任务【{name}】吗?",
|
||||||
|
"runSuccess": "任务运行成功",
|
||||||
|
"selectTaskFirst": "请先选择一个任务"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ export const MAP_PATH_TO_MENU_I18N_KEY: Record<string, string> = {
|
|||||||
'/dice': 'menus.dice.title',
|
'/dice': 'menus.dice.title',
|
||||||
'/dice/lottery_pool_config': 'menus.dice.lotteryPoolConfig',
|
'/dice/lottery_pool_config': 'menus.dice.lotteryPoolConfig',
|
||||||
'/dice/lottery_pool_config/index': 'menus.dice.lotteryPoolConfig',
|
'/dice/lottery_pool_config/index': 'menus.dice.lotteryPoolConfig',
|
||||||
|
'/dice/ante_config': 'menus.dice.anteConfig',
|
||||||
|
'/dice/ante_config/index': 'menus.dice.anteConfig',
|
||||||
'/dice/player': 'menus.dice.player',
|
'/dice/player': 'menus.dice.player',
|
||||||
'/dice/player/index': 'menus.dice.player',
|
'/dice/player/index': 'menus.dice.player',
|
||||||
'/dice/player_wallet_record': 'menus.dice.playerWalletRecord',
|
'/dice/player_wallet_record': 'menus.dice.playerWalletRecord',
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
{{ formatCoin(scope.row.coin) }}
|
{{ formatCoin(scope.row.coin) }}
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('console.newPlayer.ticket')" prop="total_ticket_count" min-width="100" align="center" />
|
|
||||||
</template>
|
</template>
|
||||||
</ArtTable>
|
</ArtTable>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,11 @@
|
|||||||
<ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData">
|
<ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData">
|
||||||
<template #left>
|
<template #left>
|
||||||
<ElSpace wrap>
|
<ElSpace wrap>
|
||||||
<ElButton v-permission="'dice:ante_config:index:save'" @click="showDialog('add')" v-ripple>
|
<ElButton
|
||||||
|
v-permission="'dice:ante_config:index:save'"
|
||||||
|
@click="showDialog('add')"
|
||||||
|
v-ripple
|
||||||
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<ArtSvgIcon icon="ri:add-fill" />
|
<ArtSvgIcon icon="ri:add-fill" />
|
||||||
</template>
|
</template>
|
||||||
@@ -40,7 +44,7 @@
|
|||||||
@pagination:current-change="handleCurrentChange"
|
@pagination:current-change="handleCurrentChange"
|
||||||
>
|
>
|
||||||
<template #is_default="{ row }">
|
<template #is_default="{ row }">
|
||||||
<ElTag :type="row.is_default === 1 ? 'success' : 'info'" size="small">
|
<ElTag :type="row.is_default === 1 ? 'primary' : 'warning'" size="small">
|
||||||
{{ row.is_default === 1 ? $t('page.table.defaultYes') : $t('page.table.defaultNo') }}
|
{{ row.is_default === 1 ? $t('page.table.defaultYes') : $t('page.table.defaultNo') }}
|
||||||
</ElTag>
|
</ElTag>
|
||||||
</template>
|
</template>
|
||||||
@@ -111,7 +115,13 @@
|
|||||||
{ prop: 'name', label: 'page.table.name', align: 'center' },
|
{ prop: 'name', label: 'page.table.name', align: 'center' },
|
||||||
{ prop: 'title', label: 'page.table.title', align: 'center' },
|
{ prop: 'title', label: 'page.table.title', align: 'center' },
|
||||||
{ prop: 'mult', label: 'page.table.mult', align: 'center' },
|
{ prop: 'mult', label: 'page.table.mult', align: 'center' },
|
||||||
{ prop: 'is_default', label: 'page.table.isDefault', width: 110, align: 'center', useSlot: true },
|
{
|
||||||
|
prop: 'is_default',
|
||||||
|
label: 'page.table.isDefault',
|
||||||
|
width: 110,
|
||||||
|
align: 'center',
|
||||||
|
useSlot: true
|
||||||
|
},
|
||||||
{ prop: 'create_time', label: 'page.table.createTime', width: 170, align: 'center' },
|
{ prop: 'create_time', label: 'page.table.createTime', width: 170, align: 'center' },
|
||||||
{ prop: 'update_time', label: 'page.table.updateTime', width: 170, align: 'center' },
|
{ prop: 'update_time', label: 'page.table.updateTime', width: 170, align: 'center' },
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
list(params: Record<string, any>) {
|
list(params: Record<string, any>) {
|
||||||
return request.get<Api.Common.ApiPage>({
|
return request.get<Api.Common.ApiPage>({
|
||||||
url: '/dice/config/DiceConfig/index',
|
url: '/core/dice/config/DiceConfig/index',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -23,7 +23,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
read(id: number | string) {
|
read(id: number | string) {
|
||||||
return request.get<Api.Common.ApiData>({
|
return request.get<Api.Common.ApiData>({
|
||||||
url: '/dice/config/DiceConfig/read?id=' + id
|
url: '/core/dice/config/DiceConfig/read?id=' + id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
save(params: Record<string, any>) {
|
save(params: Record<string, any>) {
|
||||||
return request.post<any>({
|
return request.post<any>({
|
||||||
url: '/dice/config/DiceConfig/save',
|
url: '/core/dice/config/DiceConfig/save',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -46,7 +46,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
update(params: Record<string, any>) {
|
update(params: Record<string, any>) {
|
||||||
return request.put<any>({
|
return request.put<any>({
|
||||||
url: '/dice/config/DiceConfig/update',
|
url: '/core/dice/config/DiceConfig/update',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
delete(params: Record<string, any>) {
|
delete(params: Record<string, any>) {
|
||||||
return request.del<any>({
|
return request.del<any>({
|
||||||
url: '/dice/config/DiceConfig/destroy',
|
url: '/core/dice/config/DiceConfig/destroy',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
list(params: Record<string, any>) {
|
list(params: Record<string, any>) {
|
||||||
return request.get<Api.Common.ApiPage>({
|
return request.get<Api.Common.ApiPage>({
|
||||||
url: '/dice/play_record/DicePlayRecord/index',
|
url: '/core/dice/play_record/DicePlayRecord/index',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -23,7 +23,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
read(id: number | string) {
|
read(id: number | string) {
|
||||||
return request.get<Api.Common.ApiData>({
|
return request.get<Api.Common.ApiData>({
|
||||||
url: '/dice/play_record/DicePlayRecord/read?id=' + id
|
url: '/core/dice/play_record/DicePlayRecord/read?id=' + id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
save(params: Record<string, any>) {
|
save(params: Record<string, any>) {
|
||||||
return request.post<any>({
|
return request.post<any>({
|
||||||
url: '/dice/play_record/DicePlayRecord/save',
|
url: '/core/dice/play_record/DicePlayRecord/save',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -46,7 +46,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
update(params: Record<string, any>) {
|
update(params: Record<string, any>) {
|
||||||
return request.put<any>({
|
return request.put<any>({
|
||||||
url: '/dice/play_record/DicePlayRecord/update',
|
url: '/core/dice/play_record/DicePlayRecord/update',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
delete(params: Record<string, any>) {
|
delete(params: Record<string, any>) {
|
||||||
return request.del<any>({
|
return request.del<any>({
|
||||||
url: '/dice/play_record/DicePlayRecord/destroy',
|
url: '/core/dice/play_record/DicePlayRecord/destroy',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -66,21 +66,14 @@ export default {
|
|||||||
/** 获取玩家选项(id、username) */
|
/** 获取玩家选项(id、username) */
|
||||||
getPlayerOptions() {
|
getPlayerOptions() {
|
||||||
return request.get<{ id: number; username: string }[]>({
|
return request.get<{ id: number; username: string }[]>({
|
||||||
url: '/dice/play_record/DicePlayRecord/getPlayerOptions'
|
url: '/core/dice/play_record/DicePlayRecord/getPlayerOptions'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 获取彩金池配置选项(id、name) */
|
/** 获取彩金池配置选项(id、name) */
|
||||||
getLotteryConfigOptions() {
|
getLotteryConfigOptions() {
|
||||||
return request.get<{ id: number; name: string }[]>({
|
return request.get<{ id: number; name: string }[]>({
|
||||||
url: '/dice/play_record/DicePlayRecord/getLotteryConfigOptions'
|
url: '/core/dice/play_record/DicePlayRecord/getLotteryConfigOptions'
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 获取奖励配置选项(id、ui_text、tier) */
|
|
||||||
getRewardConfigOptions() {
|
|
||||||
return request.get<{ id: number; ui_text: string; tier: string }[]>({
|
|
||||||
url: '/dice/play_record/DicePlayRecord/getRewardConfigOptions'
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
list(params: Record<string, any>) {
|
list(params: Record<string, any>) {
|
||||||
return request.get<Api.Common.ApiPage>({
|
return request.get<Api.Common.ApiPage>({
|
||||||
url: '/dice/player/DicePlayer/index',
|
url: '/core/dice/player/DicePlayer/index',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -23,7 +23,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
read(id: number | string) {
|
read(id: number | string) {
|
||||||
return request.get<Api.Common.ApiData>({
|
return request.get<Api.Common.ApiData>({
|
||||||
url: '/dice/player/DicePlayer/read?id=' + id
|
url: '/core/dice/player/DicePlayer/read?id=' + id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
save(params: Record<string, any>) {
|
save(params: Record<string, any>) {
|
||||||
return request.post<any>({
|
return request.post<any>({
|
||||||
url: '/dice/player/DicePlayer/save',
|
url: '/core/dice/player/DicePlayer/save',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -46,7 +46,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
update(params: Record<string, any>) {
|
update(params: Record<string, any>) {
|
||||||
return request.put<any>({
|
return request.put<any>({
|
||||||
url: '/dice/player/DicePlayer/update',
|
url: '/core/dice/player/DicePlayer/update',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
delete(params: Record<string, any>) {
|
delete(params: Record<string, any>) {
|
||||||
return request.del<any>({
|
return request.del<any>({
|
||||||
url: '/dice/player/DicePlayer/destroy',
|
url: '/core/dice/player/DicePlayer/destroy',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -68,7 +68,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
updateStatus(params: { id: number | string; status: number }) {
|
updateStatus(params: { id: number | string; status: number }) {
|
||||||
return request.put<any>({
|
return request.put<any>({
|
||||||
url: '/dice/player/DicePlayer/updateStatus',
|
url: '/core/dice/player/DicePlayer/updateStatus',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -79,7 +79,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
async getLotteryConfigOptions(): Promise<Array<{ id: number; name: string }>> {
|
async getLotteryConfigOptions(): Promise<Array<{ id: number; name: string }>> {
|
||||||
const res = await request.get<any>({
|
const res = await request.get<any>({
|
||||||
url: '/dice/player/DicePlayer/getLotteryConfigOptions'
|
url: '/core/dice/player/DicePlayer/getLotteryConfigOptions'
|
||||||
})
|
})
|
||||||
const rows = (Array.isArray(res) ? res : (res?.data ?? [])) as Array<{ id: number; name: string }>
|
const rows = (Array.isArray(res) ? res : (res?.data ?? [])) as Array<{ id: number; name: string }>
|
||||||
return rows.map((r) => ({ id: Number(r.id), name: String(r.name ?? r.id ?? '') }))
|
return rows.map((r) => ({ id: Number(r.id), name: String(r.name ?? r.id ?? '') }))
|
||||||
@@ -93,7 +93,7 @@ export default {
|
|||||||
Array<{ id: number; username: string; realname: string; label: string }>
|
Array<{ id: number; username: string; realname: string; label: string }>
|
||||||
> {
|
> {
|
||||||
const res = await request.get<any>({
|
const res = await request.get<any>({
|
||||||
url: '/dice/player/DicePlayer/getSystemUserOptions'
|
url: '/core/dice/player/DicePlayer/getSystemUserOptions'
|
||||||
})
|
})
|
||||||
const rows = (Array.isArray(res) ? res : (res?.data ?? [])) as Array<{
|
const rows = (Array.isArray(res) ? res : (res?.data ?? [])) as Array<{
|
||||||
id: number
|
id: number
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
list(params: Record<string, any>) {
|
list(params: Record<string, any>) {
|
||||||
return request.get<Api.Common.ApiPage>({
|
return request.get<Api.Common.ApiPage>({
|
||||||
url: '/dice/player_ticket_record/DicePlayerTicketRecord/index',
|
url: '/core/dice/player_ticket_record/DicePlayerTicketRecord/index',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -23,7 +23,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
read(id: number | string) {
|
read(id: number | string) {
|
||||||
return request.get<Api.Common.ApiData>({
|
return request.get<Api.Common.ApiData>({
|
||||||
url: '/dice/player_ticket_record/DicePlayerTicketRecord/read?id=' + id
|
url: '/core/dice/player_ticket_record/DicePlayerTicketRecord/read?id=' + id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
save(params: Record<string, any>) {
|
save(params: Record<string, any>) {
|
||||||
return request.post<any>({
|
return request.post<any>({
|
||||||
url: '/dice/player_ticket_record/DicePlayerTicketRecord/save',
|
url: '/core/dice/player_ticket_record/DicePlayerTicketRecord/save',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -46,7 +46,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
update(params: Record<string, any>) {
|
update(params: Record<string, any>) {
|
||||||
return request.put<any>({
|
return request.put<any>({
|
||||||
url: '/dice/player_ticket_record/DicePlayerTicketRecord/update',
|
url: '/core/dice/player_ticket_record/DicePlayerTicketRecord/update',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
delete(params: Record<string, any>) {
|
delete(params: Record<string, any>) {
|
||||||
return request.del<any>({
|
return request.del<any>({
|
||||||
url: '/dice/player_ticket_record/DicePlayerTicketRecord/destroy',
|
url: '/core/dice/player_ticket_record/DicePlayerTicketRecord/destroy',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -68,7 +68,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
getPlayerOptions() {
|
getPlayerOptions() {
|
||||||
return request.get<Api.Common.ApiData>({
|
return request.get<Api.Common.ApiData>({
|
||||||
url: '/dice/player_ticket_record/DicePlayerTicketRecord/getPlayerOptions'
|
url: '/core/dice/player_ticket_record/DicePlayerTicketRecord/getPlayerOptions'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,14 +57,17 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一键测试权重:创建测试记录并启动后台执行,按付费/免费、顺逆方向交替抽奖
|
* 一键测试权重:创建测试记录并启动后台执行
|
||||||
* 可选 lottery_config_id;不选则传 paid_tier_weights / free_tier_weights(T1-T5)
|
* chain_free_mode=true:仅模拟付费次数;付费抽到再来一次则插入免费抽奖(同底注、付费金额 0)
|
||||||
*/
|
*/
|
||||||
startWeightTest(params: {
|
startWeightTest(params: {
|
||||||
ante?: number
|
ante?: number
|
||||||
lottery_config_id?: number
|
lottery_config_id?: number
|
||||||
paid_lottery_config_id?: number
|
paid_lottery_config_id?: number
|
||||||
free_lottery_config_id?: number
|
free_lottery_config_id?: number
|
||||||
|
chain_free_mode?: boolean
|
||||||
|
kill_mode_enabled?: boolean
|
||||||
|
test_safety_line?: number
|
||||||
s_count?: number
|
s_count?: number
|
||||||
n_count?: number
|
n_count?: number
|
||||||
paid_s_count?: number
|
paid_s_count?: number
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
list(params: Record<string, any>) {
|
list(params: Record<string, any>) {
|
||||||
return request.get<Api.Common.ApiPage>({
|
return request.get<Api.Common.ApiPage>({
|
||||||
url: '/dice/reward_config_record/DiceRewardConfigRecord/index',
|
url: '/core/dice/reward_config_record/DiceRewardConfigRecord/index',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -23,7 +23,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
read(id: number | string) {
|
read(id: number | string) {
|
||||||
return request.get<Api.Common.ApiData>({
|
return request.get<Api.Common.ApiData>({
|
||||||
url: '/dice/reward_config_record/DiceRewardConfigRecord/read?id=' + id
|
url: '/core/dice/reward_config_record/DiceRewardConfigRecord/read?id=' + id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
save(params: Record<string, any>) {
|
save(params: Record<string, any>) {
|
||||||
return request.post<any>({
|
return request.post<any>({
|
||||||
url: '/dice/reward_config_record/DiceRewardConfigRecord/save',
|
url: '/core/dice/reward_config_record/DiceRewardConfigRecord/save',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -46,7 +46,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
update(params: Record<string, any>) {
|
update(params: Record<string, any>) {
|
||||||
return request.put<any>({
|
return request.put<any>({
|
||||||
url: '/dice/reward_config_record/DiceRewardConfigRecord/update',
|
url: '/core/dice/reward_config_record/DiceRewardConfigRecord/update',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
delete(params: Record<string, any>) {
|
delete(params: Record<string, any>) {
|
||||||
return request.del<any>({
|
return request.del<any>({
|
||||||
url: '/dice/reward_config_record/DiceRewardConfigRecord/destroy',
|
url: '/core/dice/reward_config_record/DiceRewardConfigRecord/destroy',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -77,7 +77,7 @@ export default {
|
|||||||
lottery_config_id?: number | null
|
lottery_config_id?: number | null
|
||||||
}) {
|
}) {
|
||||||
return request.post<any>({
|
return request.post<any>({
|
||||||
url: '/dice/reward_config_record/DiceRewardConfigRecord/importFromRecord',
|
url: '/core/dice/reward_config_record/DiceRewardConfigRecord/importFromRecord',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,19 +56,37 @@
|
|||||||
<!-- 抽奖类型 tag -->
|
<!-- 抽奖类型 tag -->
|
||||||
<template #lottery_type="{ row }">
|
<template #lottery_type="{ row }">
|
||||||
<ElTag size="small" :type="row.lottery_type === 0 ? 'warning' : 'success'">
|
<ElTag size="small" :type="row.lottery_type === 0 ? 'warning' : 'success'">
|
||||||
{{ row.lottery_type === 0 ? t('page.search.paid') : row.lottery_type === 1 ? t('page.search.free') : '-' }}
|
{{
|
||||||
|
row.lottery_type === 0
|
||||||
|
? t('page.search.paid')
|
||||||
|
: row.lottery_type === 1
|
||||||
|
? t('page.search.free')
|
||||||
|
: '-'
|
||||||
|
}}
|
||||||
</ElTag>
|
</ElTag>
|
||||||
</template>
|
</template>
|
||||||
<!-- 是否中大奖 tag -->
|
<!-- 是否中大奖 tag -->
|
||||||
<template #is_win="{ row }">
|
<template #is_win="{ row }">
|
||||||
<ElTag size="small" :type="row.is_win === 1 ? 'success' : 'info'">
|
<ElTag size="small" :type="row.is_win === 1 ? 'success' : 'info'">
|
||||||
{{ row.is_win === 0 ? t('page.search.noBigWin') : row.is_win === 1 ? t('page.search.bigWin') : '-' }}
|
{{
|
||||||
|
row.is_win === 0
|
||||||
|
? t('page.search.noBigWin')
|
||||||
|
: row.is_win === 1
|
||||||
|
? t('page.search.bigWin')
|
||||||
|
: '-'
|
||||||
|
}}
|
||||||
</ElTag>
|
</ElTag>
|
||||||
</template>
|
</template>
|
||||||
<!-- 方向 tag -->
|
<!-- 方向 tag -->
|
||||||
<template #direction="{ row }">
|
<template #direction="{ row }">
|
||||||
<ElTag size="small" :type="row.direction === 0 ? 'primary' : 'warning'">
|
<ElTag size="small" :type="row.direction === 0 ? 'primary' : 'warning'">
|
||||||
{{ row.direction === 0 ? t('page.search.clockwise') : row.direction === 1 ? t('page.search.anticlockwise') : '-' }}
|
{{
|
||||||
|
row.direction === 0
|
||||||
|
? t('page.search.clockwise')
|
||||||
|
: row.direction === 1
|
||||||
|
? t('page.search.anticlockwise')
|
||||||
|
: '-'
|
||||||
|
}}
|
||||||
</ElTag>
|
</ElTag>
|
||||||
</template>
|
</template>
|
||||||
<!-- 平台币相关:统一整数显示 -->
|
<!-- 平台币相关:统一整数显示 -->
|
||||||
@@ -81,6 +99,9 @@
|
|||||||
<template #reward_win_coin="{ row }">
|
<template #reward_win_coin="{ row }">
|
||||||
<span>{{ formatPlatformCoin(row?.reward_win_coin) }}</span>
|
<span>{{ formatPlatformCoin(row?.reward_win_coin) }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #paid_amount="{ row }">
|
||||||
|
<span>{{ formatPlatformCoin(row?.paid_amount) }}</span>
|
||||||
|
</template>
|
||||||
<!-- 摇取点数 tag -->
|
<!-- 摇取点数 tag -->
|
||||||
<template #roll_array="{ row }">
|
<template #roll_array="{ row }">
|
||||||
<ElTag size="small">
|
<ElTag size="small">
|
||||||
@@ -139,7 +160,7 @@
|
|||||||
direction: undefined
|
direction: undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 当前筛选下平台总盈利(付费抽奖次数×100 - 玩家总收益) */
|
/** 当前筛选下平台总盈利(付费金额 paid_amount 求和 - 玩家总收益) */
|
||||||
const totalWinCoin = ref<number | null>(null)
|
const totalWinCoin = ref<number | null>(null)
|
||||||
|
|
||||||
const listApi = async (params: Record<string, any>) => {
|
const listApi = async (params: Record<string, any>) => {
|
||||||
@@ -158,8 +179,7 @@
|
|||||||
row?.dicePlayer?.username ?? row?.player_id ?? '-'
|
row?.dicePlayer?.username ?? row?.player_id ?? '-'
|
||||||
const lotteryConfigNameFormatter = (row: Record<string, any>) =>
|
const lotteryConfigNameFormatter = (row: Record<string, any>) =>
|
||||||
row?.diceLotteryPoolConfig?.name ?? row?.lottery_config_id ?? '-'
|
row?.diceLotteryPoolConfig?.name ?? row?.lottery_config_id ?? '-'
|
||||||
const rewardTierFormatter = (row: Record<string, any>) =>
|
const rewardTierFormatter = (row: Record<string, any>) => row?.reward_tier ?? '-'
|
||||||
row?.diceRewardConfig?.tier ?? row?.reward_config_id ?? '-'
|
|
||||||
|
|
||||||
/** 摇取点数格式化为 1,3,4,5,6,6 */
|
/** 摇取点数格式化为 1,3,4,5,6,6 */
|
||||||
function formatRollArray(val: unknown): string {
|
function formatRollArray(val: unknown): string {
|
||||||
@@ -180,7 +200,7 @@
|
|||||||
if (val === '' || val === null || val === undefined) return '-'
|
if (val === '' || val === null || val === undefined) return '-'
|
||||||
const n = typeof val === 'number' ? val : Number(val)
|
const n = typeof val === 'number' ? val : Number(val)
|
||||||
if (!Number.isFinite(n)) return '-'
|
if (!Number.isFinite(n)) return '-'
|
||||||
return String(Math.trunc(n))
|
return n.toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格配置
|
// 表格配置
|
||||||
@@ -216,25 +236,32 @@
|
|||||||
useSlot: true
|
useSlot: true
|
||||||
},
|
},
|
||||||
{ prop: 'lottery_type', label: 'page.table.drawType', width: 100, useSlot: true },
|
{ prop: 'lottery_type', label: 'page.table.drawType', width: 100, useSlot: true },
|
||||||
|
{ prop: 'direction', label: 'page.table.direction', width: 90, useSlot: true },
|
||||||
{ prop: 'ante', label: 'page.table.ante', width: 80, align: 'center' },
|
{ prop: 'ante', label: 'page.table.ante', width: 80, align: 'center' },
|
||||||
{ prop: 'paid_amount', label: 'page.table.paidAmount', width: 110, align: 'center' },
|
{ prop: 'paid_amount', label: 'page.table.paidAmount', width: 110, align: 'center', useSlot: true },
|
||||||
{ prop: 'is_win', label: 'page.table.isBigWin', width: 100, useSlot: true },
|
{ prop: 'is_win', label: 'page.table.isBigWin', width: 100, useSlot: true },
|
||||||
{ prop: 'win_coin', label: 'page.table.winCoin', width: 110, useSlot: true },
|
{ prop: 'win_coin', label: 'page.table.winCoin', width: 110, useSlot: true },
|
||||||
{ prop: 'super_win_coin', label: 'page.table.superWinCoin', width: 120, useSlot: true },
|
{ prop: 'super_win_coin', label: 'page.table.superWinCoin', width: 120, useSlot: true },
|
||||||
{ prop: 'reward_win_coin', label: 'page.table.rewardWinCoin', width: 140, useSlot: true },
|
{ prop: 'reward_win_coin', label: 'page.table.rewardWinCoin', width: 140, useSlot: true },
|
||||||
{ prop: 'direction', label: 'page.table.direction', width: 90, useSlot: true },
|
|
||||||
{ prop: 'start_index', label: 'page.table.startIndex', width: 90 },
|
{ prop: 'start_index', label: 'page.table.startIndex', width: 90 },
|
||||||
{ prop: 'target_index', label: 'page.table.targetIndex', width: 90 },
|
{ prop: 'target_index', label: 'page.table.targetIndex', width: 90 },
|
||||||
{ prop: 'roll_array', label: 'page.table.rollArray', width: 140, useSlot: true },
|
{ prop: 'roll_array', label: 'page.table.rollArray', width: 140, useSlot: true },
|
||||||
{ prop: 'roll_number', label: 'page.table.rollNumber', width: 110, sortable: true },
|
{ prop: 'roll_number', label: 'page.table.rollNumber', width: 110, sortable: true },
|
||||||
{
|
{
|
||||||
prop: 'reward_config_id',
|
prop: 'reward_tier',
|
||||||
label: 'page.table.rewardConfig',
|
label: 'page.table.rewardTier',
|
||||||
|
width: 100,
|
||||||
formatter: (row: Record<string, any>) => rewardTierFormatter(row)
|
formatter: (row: Record<string, any>) => rewardTierFormatter(row)
|
||||||
},
|
},
|
||||||
{ prop: 'create_time', label: 'page.table.createTime', width: 170 },
|
{ prop: 'create_time', label: 'page.table.createTime', width: 170 },
|
||||||
{ prop: 'update_time', label: 'page.table.updateTime', width: 170 },
|
{ prop: 'update_time', label: 'page.table.updateTime', width: 170 },
|
||||||
{ prop: 'operation', label: 'table.actions.operation', width: 100, fixed: 'right', useSlot: true }
|
{
|
||||||
|
prop: 'operation',
|
||||||
|
label: 'table.actions.operation',
|
||||||
|
width: 100,
|
||||||
|
fixed: 'right',
|
||||||
|
useSlot: true
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -153,25 +153,21 @@
|
|||||||
:disabled="dialogType === 'edit'"
|
:disabled="dialogType === 'edit'"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('page.form.rewardConfig')" prop="reward_config_id">
|
<el-form-item :label="$t('page.form.rewardTier')" prop="reward_tier">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.reward_config_id"
|
v-model="formData.reward_tier"
|
||||||
:placeholder="$t('page.form.placeholderRewardConfig')"
|
:placeholder="$t('page.form.placeholderRewardTier')"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:disabled="dialogType === 'edit'"
|
:disabled="true"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option label="T1" value="T1" />
|
||||||
v-for="item in rewardConfigOptions"
|
<el-option label="T2" value="T2" />
|
||||||
:key="item.id"
|
<el-option label="T3" value="T3" />
|
||||||
:label="
|
<el-option label="T4" value="T4" />
|
||||||
item.ui_text
|
<el-option label="T5" value="T5" />
|
||||||
? `${item.ui_text}${item.tier ? ' (' + item.tier + ')' : ''}`
|
<el-option label="BIGWIN" value="BIGWIN" />
|
||||||
: String(item.id)
|
|
||||||
"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -239,12 +235,11 @@
|
|||||||
trigger: 'change'
|
trigger: 'change'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
reward_config_id: [{ required: true, message: '请选择奖励配置', trigger: 'change' }]
|
reward_tier: [{ required: true, message: '请选择中奖档位', trigger: 'change' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
const playerOptions = ref<Array<{ id: number; username: string }>>([])
|
const playerOptions = ref<Array<{ id: number; username: string }>>([])
|
||||||
const lotteryConfigOptions = ref<Array<{ id: number; name: string }>>([])
|
const lotteryConfigOptions = ref<Array<{ id: number; name: string }>>([])
|
||||||
const rewardConfigOptions = ref<Array<{ id: number; ui_text: string; tier: string }>>([])
|
|
||||||
|
|
||||||
const initialFormData = {
|
const initialFormData = {
|
||||||
id: null as number | null,
|
id: null as number | null,
|
||||||
@@ -260,7 +255,7 @@
|
|||||||
target_index: null as number | null,
|
target_index: null as number | null,
|
||||||
roll_array: null as string | number[] | null,
|
roll_array: null as string | number[] | null,
|
||||||
roll_number: null as number | null,
|
roll_number: null as number | null,
|
||||||
reward_config_id: null as number | null
|
reward_tier: '' as string
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 摇取点数固定 5 位 [n0..n4],每项 1~6 */
|
/** 摇取点数固定 5 位 [n0..n4],每项 1~6 */
|
||||||
@@ -277,22 +272,17 @@
|
|||||||
if (open) {
|
if (open) {
|
||||||
initPage()
|
initPage()
|
||||||
try {
|
try {
|
||||||
const [players, lotteryConfigs, rewardConfigs] = await Promise.all([
|
const [players, lotteryConfigs] = await Promise.all([
|
||||||
api.getPlayerOptions(),
|
api.getPlayerOptions(),
|
||||||
api.getLotteryConfigOptions(),
|
api.getLotteryConfigOptions()
|
||||||
api.getRewardConfigOptions()
|
|
||||||
])
|
])
|
||||||
playerOptions.value = Array.isArray(players) ? players : ((players as any)?.data ?? [])
|
playerOptions.value = Array.isArray(players) ? players : ((players as any)?.data ?? [])
|
||||||
lotteryConfigOptions.value = Array.isArray(lotteryConfigs)
|
lotteryConfigOptions.value = Array.isArray(lotteryConfigs)
|
||||||
? lotteryConfigs
|
? lotteryConfigs
|
||||||
: ((lotteryConfigs as any)?.data ?? [])
|
: ((lotteryConfigs as any)?.data ?? [])
|
||||||
rewardConfigOptions.value = Array.isArray(rewardConfigs)
|
|
||||||
? rewardConfigs
|
|
||||||
: ((rewardConfigs as any)?.data ?? [])
|
|
||||||
} catch {
|
} catch {
|
||||||
playerOptions.value = []
|
playerOptions.value = []
|
||||||
lotteryConfigOptions.value = []
|
lotteryConfigOptions.value = []
|
||||||
rewardConfigOptions.value = []
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -322,7 +312,7 @@
|
|||||||
'target_index',
|
'target_index',
|
||||||
'roll_array',
|
'roll_array',
|
||||||
'roll_number',
|
'roll_number',
|
||||||
'reward_config_id'
|
'reward_tier'
|
||||||
]
|
]
|
||||||
keys.forEach((key) => {
|
keys.forEach((key) => {
|
||||||
const val = props.data![key]
|
const val = props.data![key]
|
||||||
|
|||||||
@@ -101,6 +101,7 @@
|
|||||||
<el-option label="T3" value="T3" />
|
<el-option label="T3" value="T3" />
|
||||||
<el-option label="T4" value="T4" />
|
<el-option label="T4" value="T4" />
|
||||||
<el-option label="T5" value="T5" />
|
<el-option label="T5" value="T5" />
|
||||||
|
<el-option label="BIGWIN" value="BIGWIN" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
<ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData">
|
<ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData">
|
||||||
<template #left>
|
<template #left>
|
||||||
<span v-if="totalWinCoin !== null" class="table-summary-inline">
|
<span v-if="totalWinCoin !== null" class="table-summary-inline">
|
||||||
{{ $t('page.toolbar.platformTotalProfit') }}:<strong>{{ formatPlatformCoin(totalWinCoin) }}</strong>
|
{{ $t('page.toolbar.platformTotalProfit') }}:<strong>{{
|
||||||
|
formatPlatformCoin(totalWinCoin)
|
||||||
|
}}</strong>
|
||||||
</span>
|
</span>
|
||||||
<ElSpace wrap class="table-toolbar-buttons">
|
<ElSpace wrap class="table-toolbar-buttons">
|
||||||
<ElButton
|
<ElButton
|
||||||
@@ -97,8 +99,8 @@
|
|||||||
{{ formatRollArray(row.roll_array) }}
|
{{ formatRollArray(row.roll_array) }}
|
||||||
</ElTag>
|
</ElTag>
|
||||||
</template>
|
</template>
|
||||||
<!-- 奖励档位:显示 DiceRewardConfig.tier -->
|
<!-- 奖励档位:优先显示记录自带 reward_tier -->
|
||||||
<template #reward_config_id="{ row }">
|
<template #reward_tier="{ row }">
|
||||||
<ElTag size="small">{{ rewardTierFormatter(row) }}</ElTag>
|
<ElTag size="small">{{ rewardTierFormatter(row) }}</ElTag>
|
||||||
</template>
|
</template>
|
||||||
<!-- 平台币相关:统一整数显示 -->
|
<!-- 平台币相关:统一整数显示 -->
|
||||||
@@ -169,7 +171,7 @@
|
|||||||
roll_number: undefined
|
roll_number: undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
// 当前筛选下平台总盈利(付费抽奖次数×100 - 玩家总收益)
|
// 当前筛选下平台总盈利(付费金额 paid_amount 求和 - 玩家总收益)
|
||||||
const totalWinCoin = ref<number | null>(null)
|
const totalWinCoin = ref<number | null>(null)
|
||||||
|
|
||||||
const listApi = async (params: Record<string, any>) => {
|
const listApi = async (params: Record<string, any>) => {
|
||||||
@@ -180,8 +182,7 @@
|
|||||||
|
|
||||||
const lotteryConfigNameFormatter = (row: Record<string, any>) =>
|
const lotteryConfigNameFormatter = (row: Record<string, any>) =>
|
||||||
row?.diceLotteryPoolConfig?.name ?? row?.lottery_config_id ?? '-'
|
row?.diceLotteryPoolConfig?.name ?? row?.lottery_config_id ?? '-'
|
||||||
const rewardTierFormatter = (row: Record<string, any>) =>
|
const rewardTierFormatter = (row: Record<string, any>) => row?.reward_tier ?? '-'
|
||||||
row?.diceRewardConfig?.tier ?? row?.reward_config_id ?? '-'
|
|
||||||
|
|
||||||
/** 摇取点数格式化为 1,3,4,5,6 */
|
/** 摇取点数格式化为 1,3,4,5,6 */
|
||||||
function formatRollArray(val: unknown): string {
|
function formatRollArray(val: unknown): string {
|
||||||
@@ -202,20 +203,20 @@
|
|||||||
if (val === '' || val === null || val === undefined) return '-'
|
if (val === '' || val === null || val === undefined) return '-'
|
||||||
const n = typeof val === 'number' ? val : Number(val)
|
const n = typeof val === 'number' ? val : Number(val)
|
||||||
if (!Number.isFinite(n)) return '-'
|
if (!Number.isFinite(n)) return '-'
|
||||||
return String(Math.trunc(n))
|
return n.toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClearAll = async () => {
|
const handleClearAll = async () => {
|
||||||
try {
|
try {
|
||||||
await ElMessageBox.confirm('确定清空所有玩家抽奖测试数据?', '提示', {
|
await ElMessageBox.confirm(t('page.ui.clearAllConfirm'), t('uiMsg.titlePrompt'), {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
await api.clearAll()
|
await api.clearAll()
|
||||||
ElMessage.success('已清空所有测试数据')
|
ElMessage.success(t('page.ui.clearAllSuccess'))
|
||||||
getData()
|
getData()
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
if (e !== 'cancel') {
|
if (e !== 'cancel') {
|
||||||
ElMessage.error(e?.message || '清空失败')
|
ElMessage.error(e?.message || t('page.ui.clearAllFail'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -258,18 +259,18 @@
|
|||||||
useSlot: true
|
useSlot: true
|
||||||
},
|
},
|
||||||
{ prop: 'lottery_type', label: 'page.table.drawType', width: 100, useSlot: true },
|
{ prop: 'lottery_type', label: 'page.table.drawType', width: 100, useSlot: true },
|
||||||
|
{ prop: 'direction', label: 'page.table.direction', width: 90, useSlot: true },
|
||||||
|
{ prop: 'ante', label: 'page.table.ante', width: 90 },
|
||||||
{ prop: 'is_win', label: 'page.table.isBigWin', width: 100, useSlot: true },
|
{ prop: 'is_win', label: 'page.table.isBigWin', width: 100, useSlot: true },
|
||||||
{ prop: 'paid_amount', label: 'page.table.paidAmount', width: 130 },
|
{ prop: 'paid_amount', label: 'page.table.paidAmount', width: 130 },
|
||||||
{ prop: 'ante', label: 'page.table.ante', width: 90 },
|
|
||||||
{ prop: 'win_coin', label: 'page.table.winCoin', width: 110, useSlot: true },
|
{ prop: 'win_coin', label: 'page.table.winCoin', width: 110, useSlot: true },
|
||||||
{ prop: 'super_win_coin', label: 'page.table.superWinCoin', width: 120, useSlot: true },
|
{ prop: 'super_win_coin', label: 'page.table.superWinCoin', width: 120, useSlot: true },
|
||||||
{ prop: 'reward_win_coin', label: 'page.table.rewardWinCoin', width: 140, useSlot: true },
|
{ prop: 'reward_win_coin', label: 'page.table.rewardWinCoin', width: 140, useSlot: true },
|
||||||
{ prop: 'direction', label: 'page.table.direction', width: 90, useSlot: true },
|
|
||||||
{ prop: 'start_index', label: 'page.table.startIndex', width: 90 },
|
{ prop: 'start_index', label: 'page.table.startIndex', width: 90 },
|
||||||
{ prop: 'target_index', label: 'page.table.targetIndex', width: 90 },
|
{ prop: 'target_index', label: 'page.table.targetIndex', width: 90 },
|
||||||
{ prop: 'roll_array', label: 'page.table.rollArray', width: 140, useSlot: true },
|
{ prop: 'roll_array', label: 'page.table.rollArray', width: 140, useSlot: true },
|
||||||
{ prop: 'roll_number', label: 'page.table.rollNumber', width: 110, sortable: true },
|
{ prop: 'roll_number', label: 'page.table.rollNumber', width: 110, sortable: true },
|
||||||
{ prop: 'reward_config_id', label: 'page.table.rewardConfig', width: 100, useSlot: true },
|
{ prop: 'reward_tier', label: 'page.table.rewardTier', width: 100, useSlot: true },
|
||||||
{ prop: 'status', label: 'page.table.status', width: 80, useSlot: true },
|
{ prop: 'status', label: 'page.table.status', width: 80, useSlot: true },
|
||||||
{ prop: 'create_time', label: 'page.table.createTime', width: 170 },
|
{ prop: 'create_time', label: 'page.table.createTime', width: 170 },
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -67,21 +67,15 @@
|
|||||||
:placeholder="$t('page.form.placeholderRewardTier')"
|
:placeholder="$t('page.form.placeholderRewardTier')"
|
||||||
clearable
|
clearable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@change="onRewardTierChange"
|
|
||||||
>
|
>
|
||||||
<el-option label="T1" value="T1" />
|
<el-option label="T1" value="T1" />
|
||||||
<el-option label="T2" value="T2" />
|
<el-option label="T2" value="T2" />
|
||||||
<el-option label="T3" value="T3" />
|
<el-option label="T3" value="T3" />
|
||||||
<el-option label="T4" value="T4" />
|
<el-option label="T4" value="T4" />
|
||||||
<el-option label="T5" value="T5" />
|
<el-option label="T5" value="T5" />
|
||||||
|
<el-option label="BIGWIN" value="BIGWIN" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('page.form.rewardConfigId')" prop="reward_config_id">
|
|
||||||
<el-input
|
|
||||||
v-model="formData.reward_config_id"
|
|
||||||
:placeholder="$t('page.form.placeholderRewardConfigId')"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('page.table.startIndex')" prop="start_index">
|
<el-form-item :label="$t('page.table.startIndex')" prop="start_index">
|
||||||
<el-input v-model="formData.start_index" :placeholder="$t('page.form.placeholderStartIndex')" />
|
<el-input v-model="formData.start_index" :placeholder="$t('page.form.placeholderStartIndex')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -128,7 +122,6 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import api from '../../../api/play_record_test/index'
|
import api from '../../../api/play_record_test/index'
|
||||||
import rewardConfigApi from '../../../api/reward_config/index'
|
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
@@ -171,7 +164,7 @@
|
|||||||
lottery_type: [{ required: true, message: t('page.form.ruleDrawTypeRequired'), trigger: 'blur' }],
|
lottery_type: [{ required: true, message: t('page.form.ruleDrawTypeRequired'), trigger: 'blur' }],
|
||||||
is_win: [{ required: true, message: t('page.form.ruleIsBigWinRequired'), trigger: 'blur' }],
|
is_win: [{ required: true, message: t('page.form.ruleIsBigWinRequired'), trigger: 'blur' }],
|
||||||
direction: [{ required: true, message: t('page.form.ruleDirectionRequired'), trigger: 'blur' }],
|
direction: [{ required: true, message: t('page.form.ruleDirectionRequired'), trigger: 'blur' }],
|
||||||
reward_config_id: [{ required: true, message: t('page.form.ruleRewardConfigIdRequired'), trigger: 'blur' }],
|
reward_tier: [{ required: true, message: t('page.form.ruleRewardTierRequired'), trigger: 'blur' }],
|
||||||
status: [{ required: true, message: t('page.form.ruleStatusRequired'), trigger: 'blur' }]
|
status: [{ required: true, message: t('page.form.ruleStatusRequired'), trigger: 'blur' }]
|
||||||
}))
|
}))
|
||||||
|
|
||||||
@@ -188,7 +181,6 @@
|
|||||||
win_coin: 0,
|
win_coin: 0,
|
||||||
direction: null,
|
direction: null,
|
||||||
reward_tier: undefined as string | undefined,
|
reward_tier: undefined as string | undefined,
|
||||||
reward_config_id: null,
|
|
||||||
start_index: null,
|
start_index: null,
|
||||||
target_index: null,
|
target_index: null,
|
||||||
roll_number: null,
|
roll_number: null,
|
||||||
@@ -242,7 +234,6 @@
|
|||||||
const initForm = () => {
|
const initForm = () => {
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
for (const key in formData) {
|
for (const key in formData) {
|
||||||
if (key === 'reward_tier') continue
|
|
||||||
if (props.data[key] != null && props.data[key] !== undefined) {
|
if (props.data[key] != null && props.data[key] !== undefined) {
|
||||||
;(formData as Record<string, unknown>)[key] = props.data[key]
|
;(formData as Record<string, unknown>)[key] = props.data[key]
|
||||||
}
|
}
|
||||||
@@ -253,30 +244,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 中奖档位变更:按档位拉取奖励配置并取第一条的 id 填入 reward_config_id
|
|
||||||
*/
|
|
||||||
async function onRewardTierChange(tier: string) {
|
|
||||||
if (!tier) {
|
|
||||||
formData.reward_config_id = null
|
|
||||||
return
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const res = await rewardConfigApi.list({
|
|
||||||
saiType: 'all',
|
|
||||||
tier: tier
|
|
||||||
})
|
|
||||||
const list = res?.data
|
|
||||||
const first = Array.isArray(list) && list.length > 0 ? list[0] : undefined
|
|
||||||
if (first && first.id != null) {
|
|
||||||
formData.reward_config_id = first.id
|
|
||||||
} else {
|
|
||||||
formData.reward_config_id = null
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
formData.reward_config_id = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关闭弹窗并重置表单
|
* 关闭弹窗并重置表单
|
||||||
@@ -294,7 +261,6 @@
|
|||||||
try {
|
try {
|
||||||
await formRef.value.validate()
|
await formRef.value.validate()
|
||||||
const payload = { ...formData }
|
const payload = { ...formData }
|
||||||
delete (payload as Record<string, unknown>).reward_tier
|
|
||||||
if (props.dialogType === 'add') {
|
if (props.dialogType === 'add') {
|
||||||
await api.save(payload)
|
await api.save(payload)
|
||||||
ElMessage.success(t('page.form.addSuccess'))
|
ElMessage.success(t('page.form.addSuccess'))
|
||||||
|
|||||||
@@ -95,6 +95,7 @@
|
|||||||
<el-option label="T3" value="T3" />
|
<el-option label="T3" value="T3" />
|
||||||
<el-option label="T4" value="T4" />
|
<el-option label="T4" value="T4" />
|
||||||
<el-option label="T5" value="T5" />
|
<el-option label="T5" value="T5" />
|
||||||
|
<el-option label="BIGWIN" value="BIGWIN" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|||||||
@@ -98,6 +98,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
||||||
import api from '../../api/player/index'
|
import api from '../../api/player/index'
|
||||||
@@ -105,6 +106,8 @@
|
|||||||
import EditDialog from './modules/edit-dialog.vue'
|
import EditDialog from './modules/edit-dialog.vue'
|
||||||
import WalletOperateDialog from './modules/WalletOperateDialog.vue'
|
import WalletOperateDialog from './modules/WalletOperateDialog.vue'
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
// 搜索表单
|
// 搜索表单
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
username: undefined,
|
username: undefined,
|
||||||
@@ -129,7 +132,8 @@
|
|||||||
|
|
||||||
// 根据 lottery_config_id 显示彩金池配置名称
|
// 根据 lottery_config_id 显示彩金池配置名称
|
||||||
const lotteryConfigNameFormatter = (row: any) =>
|
const lotteryConfigNameFormatter = (row: any) =>
|
||||||
row?.diceLotteryPoolConfig?.name ?? (row?.lottery_config_id ? `#${row.lottery_config_id}` : '未知')
|
row?.diceLotteryPoolConfig?.name ??
|
||||||
|
(row?.lottery_config_id ? `#${row.lottery_config_id}` : t('page.table.customConfig'))
|
||||||
|
|
||||||
// 表格
|
// 表格
|
||||||
const {
|
const {
|
||||||
@@ -163,7 +167,7 @@
|
|||||||
{
|
{
|
||||||
prop: 'coin',
|
prop: 'coin',
|
||||||
label: 'page.table.coin',
|
label: 'page.table.coin',
|
||||||
width: 100,
|
width: 110,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
useSlot: true
|
useSlot: true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -146,11 +146,11 @@
|
|||||||
return player?.username ?? row.player_id ?? '-'
|
return player?.username ?? row.player_id ?? '-'
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatInteger(val: unknown): string {
|
function formatMoney2(val: unknown): string {
|
||||||
if (val === '' || val === null || val === undefined) return '-'
|
if (val === '' || val === null || val === undefined) return '-'
|
||||||
const n = typeof val === 'number' ? val : Number(val)
|
const n = typeof val === 'number' ? val : Number(val)
|
||||||
if (!Number.isFinite(n)) return '-'
|
if (!Number.isFinite(n)) return '-'
|
||||||
return String(Math.trunc(n))
|
return n.toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格配置
|
// 表格配置
|
||||||
@@ -202,14 +202,14 @@
|
|||||||
label: 'page.table.walletBefore',
|
label: 'page.table.walletBefore',
|
||||||
width: 110,
|
width: 110,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: (row: Record<string, any>) => formatInteger(row?.wallet_before)
|
formatter: (row: Record<string, any>) => formatMoney2(row?.wallet_before)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'wallet_after',
|
prop: 'wallet_after',
|
||||||
label: 'page.table.walletAfter',
|
label: 'page.table.walletAfter',
|
||||||
width: 110,
|
width: 110,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: (row: Record<string, any>) => formatInteger(row?.wallet_after)
|
formatter: (row: Record<string, any>) => formatMoney2(row?.wallet_after)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
|
|||||||
@@ -45,7 +45,8 @@
|
|||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="formData.coin"
|
v-model="formData.coin"
|
||||||
:placeholder="$t('page.form.placeholderCoinChange')"
|
:placeholder="$t('page.form.placeholderCoinChange')"
|
||||||
:precision="0"
|
:precision="2"
|
||||||
|
:step="1"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@change="onCoinChange"
|
@change="onCoinChange"
|
||||||
:disabled="dialogType === 'edit'"
|
:disabled="dialogType === 'edit'"
|
||||||
@@ -55,7 +56,7 @@
|
|||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="formData.wallet_before"
|
v-model="formData.wallet_before"
|
||||||
:placeholder="$t('page.form.placeholderWalletBefore')"
|
:placeholder="$t('page.form.placeholderWalletBefore')"
|
||||||
:precision="0"
|
:precision="2"
|
||||||
disabled
|
disabled
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
@@ -64,7 +65,7 @@
|
|||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="formData.wallet_after"
|
v-model="formData.wallet_after"
|
||||||
:placeholder="$t('page.form.placeholderWalletAfter')"
|
:placeholder="$t('page.form.placeholderWalletAfter')"
|
||||||
:precision="0"
|
:precision="2"
|
||||||
disabled
|
disabled
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
@@ -178,7 +179,7 @@
|
|||||||
function calcWalletAfter() {
|
function calcWalletAfter() {
|
||||||
const before = Number(formData.wallet_before) || 0
|
const before = Number(formData.wallet_before) || 0
|
||||||
const coin = Number(formData.coin) || 0
|
const coin = Number(formData.coin) || 0
|
||||||
formData.wallet_after = Math.trunc(before + coin)
|
formData.wallet_after = Number((before + coin).toFixed(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
@@ -204,11 +205,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeInteger(val: unknown, fallback: number): number {
|
function normalizeMoney2(val: unknown, fallback: number): number {
|
||||||
if (val === '' || val === null || val === undefined) return fallback
|
if (val === '' || val === null || val === undefined) return fallback
|
||||||
const n = typeof val === 'number' ? val : Number(val)
|
const n = typeof val === 'number' ? val : Number(val)
|
||||||
if (!Number.isFinite(n)) return fallback
|
if (!Number.isFinite(n)) return fallback
|
||||||
return Math.trunc(n)
|
return Number(n.toFixed(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
const initForm = () => {
|
const initForm = () => {
|
||||||
@@ -218,9 +219,9 @@
|
|||||||
formData.player_id =
|
formData.player_id =
|
||||||
props.data.player_id != null && props.data.player_id !== '' ? Number(props.data.player_id) : null
|
props.data.player_id != null && props.data.player_id !== '' ? Number(props.data.player_id) : null
|
||||||
formData.type = props.data.type != null && props.data.type !== '' ? Number(props.data.type) : null
|
formData.type = props.data.type != null && props.data.type !== '' ? Number(props.data.type) : null
|
||||||
formData.coin = normalizeInteger(props.data.coin, 0)
|
formData.coin = normalizeMoney2(props.data.coin, 0)
|
||||||
formData.wallet_before = normalizeInteger(props.data.wallet_before, 0)
|
formData.wallet_before = normalizeMoney2(props.data.wallet_before, 0)
|
||||||
formData.wallet_after = normalizeInteger(props.data.wallet_after, 0)
|
formData.wallet_after = normalizeMoney2(props.data.wallet_after, 0)
|
||||||
formData.remark = props.data.remark ?? ''
|
formData.remark = props.data.remark ?? ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,11 +70,11 @@
|
|||||||
return api.list({ ...params, direction: currentDirection.value })
|
return api.list({ ...params, direction: currentDirection.value })
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatInteger(val: unknown): string {
|
function formatMoney2(val: unknown): string {
|
||||||
if (val === '' || val === null || val === undefined) return '-'
|
if (val === '' || val === null || val === undefined) return '-'
|
||||||
const n = typeof val === 'number' ? val : Number(val)
|
const n = typeof val === 'number' ? val : Number(val)
|
||||||
if (!Number.isFinite(n)) return '-'
|
if (!Number.isFinite(n)) return '-'
|
||||||
return String(Math.trunc(n))
|
return n.toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSearch = (params: Record<string, any>) => {
|
const handleSearch = (params: Record<string, any>) => {
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
label: 'page.table.realEv',
|
label: 'page.table.realEv',
|
||||||
width: 110,
|
width: 110,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: (row: Record<string, any>) => formatInteger(row?.real_ev)
|
formatter: (row: Record<string, any>) => formatMoney2(row?.real_ev)
|
||||||
},
|
},
|
||||||
{ prop: 'remark', label: 'page.table.remark', minWidth: 80, align: 'center', showOverflowTooltip: true },
|
{ prop: 'remark', label: 'page.table.remark', minWidth: 80, align: 'center', showOverflowTooltip: true },
|
||||||
{ prop: 'weight', label: 'page.table.weight', width: 110, align: 'center' }
|
{ prop: 'weight', label: 'page.table.weight', width: 110, align: 'center' }
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span>{{ formatInteger(row?.real_ev) }}</span>
|
<span>{{ formatMoney2(row?.real_ev) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -254,11 +254,11 @@
|
|||||||
import api from '../../../api/reward/index'
|
import api from '../../../api/reward/index'
|
||||||
import ArtBarChart from '@/components/core/charts/art-bar-chart/index.vue'
|
import ArtBarChart from '@/components/core/charts/art-bar-chart/index.vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
function formatInteger(val: unknown): string {
|
function formatMoney2(val: unknown): string {
|
||||||
if (val === '' || val === null || val === undefined) return '-'
|
if (val === '' || val === null || val === undefined) return '-'
|
||||||
const n = typeof val === 'number' ? val : Number(val)
|
const n = typeof val === 'number' ? val : Number(val)
|
||||||
if (!Number.isFinite(n)) return '-'
|
if (!Number.isFinite(n)) return '-'
|
||||||
return String(Math.trunc(n))
|
return n.toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span>{{ formatInteger(row?.real_ev) }}</span>
|
<span>{{ formatMoney2(row?.real_ev) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -319,11 +319,11 @@
|
|||||||
import ArtBarChart from '@/components/core/charts/art-bar-chart/index.vue'
|
import ArtBarChart from '@/components/core/charts/art-bar-chart/index.vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
function formatInteger(val: unknown): string {
|
function formatMoney2(val: unknown): string {
|
||||||
if (val === '' || val === null || val === undefined) return '-'
|
if (val === '' || val === null || val === undefined) return '-'
|
||||||
const n = typeof val === 'number' ? val : Number(val)
|
const n = typeof val === 'number' ? val : Number(val)
|
||||||
if (!Number.isFinite(n)) return '-'
|
if (!Number.isFinite(n)) return '-'
|
||||||
return String(Math.trunc(n))
|
return n.toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,17 +11,30 @@
|
|||||||
<template #title>{{ $t('page.weightTest.alertTitle') }}</template>
|
<template #title>{{ $t('page.weightTest.alertTitle') }}</template>
|
||||||
{{ $t('page.weightTest.alertBody') }}
|
{{ $t('page.weightTest.alertBody') }}
|
||||||
</ElAlert>
|
</ElAlert>
|
||||||
<ElForm ref="formRef" :model="form" label-width="140px">
|
<ElAlert type="warning" :closable="false" show-icon class="weight-test-tip chain-tip">
|
||||||
|
{{ $t('page.weightTest.chainModeHint') }}
|
||||||
|
</ElAlert>
|
||||||
|
<ElAlert type="info" :closable="false" show-icon class="weight-test-tip chain-tip">
|
||||||
|
{{ $t('page.weightTest.killModeHint') }}
|
||||||
|
</ElAlert>
|
||||||
|
<ElForm :model="form" label-width="140px">
|
||||||
<ElFormItem :label="$t('page.weightTest.labelAnte')" prop="ante" required>
|
<ElFormItem :label="$t('page.weightTest.labelAnte')" prop="ante" required>
|
||||||
<ElInputNumber v-model="form.ante" :min="1" :step="1" style="width: 100%" />
|
<ElInputNumber v-model="form.ante" :min="1" :step="1" style="width: 100%" />
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<ElSteps :active="currentStep" finish-status="success" simple class="steps-wrap">
|
<ElFormItem :label="$t('page.weightTest.labelKillModeEnabled')" prop="kill_mode_enabled">
|
||||||
<ElStep :title="$t('page.weightTest.stepPaid')" />
|
<ElSwitch v-model="form.kill_mode_enabled" />
|
||||||
<ElStep :title="$t('page.weightTest.stepFree')" />
|
</ElFormItem>
|
||||||
</ElSteps>
|
<ElFormItem :label="$t('page.weightTest.labelTestSafetyLine')" prop="test_safety_line">
|
||||||
|
<ElInputNumber
|
||||||
|
v-model="form.test_safety_line"
|
||||||
|
:min="0"
|
||||||
|
:step="100"
|
||||||
|
:disabled="!form.kill_mode_enabled"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</ElFormItem>
|
||||||
|
|
||||||
<!-- 第一页:付费抽奖券 -->
|
<div class="section-title">{{ $t('page.weightTest.sectionPaid') }}</div>
|
||||||
<div v-show="currentStep === 0" class="step-panel">
|
|
||||||
<ElFormItem
|
<ElFormItem
|
||||||
:label="$t('page.weightTest.labelLotteryTypePaid')"
|
:label="$t('page.weightTest.labelLotteryTypePaid')"
|
||||||
prop="paid_lottery_config_id"
|
prop="paid_lottery_config_id"
|
||||||
@@ -83,10 +96,8 @@
|
|||||||
<ElOption v-for="c in countOptions" :key="c" :label="String(c)" :value="c" />
|
<ElOption v-for="c in countOptions" :key="c" :label="String(c)" :value="c" />
|
||||||
</ElSelect>
|
</ElSelect>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 第二页:免费抽奖券 -->
|
<div class="section-title">{{ $t('page.weightTest.sectionFreeAfterPlayAgain') }}</div>
|
||||||
<div v-show="currentStep === 1" class="step-panel">
|
|
||||||
<ElFormItem
|
<ElFormItem
|
||||||
:label="$t('page.weightTest.labelLotteryTypeFree')"
|
:label="$t('page.weightTest.labelLotteryTypeFree')"
|
||||||
prop="free_lottery_config_id"
|
prop="free_lottery_config_id"
|
||||||
@@ -107,7 +118,7 @@
|
|||||||
</ElSelect>
|
</ElSelect>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
<template v-if="form.free_lottery_config_id == null">
|
<template v-if="form.free_lottery_config_id == null">
|
||||||
<div class="tier-label">{{ $t('page.weightTest.tierProbHint') }}</div>
|
<div class="tier-label">{{ $t('page.weightTest.tierProbHintFreeChain') }}</div>
|
||||||
<ElRow :gutter="12" class="tier-row">
|
<ElRow :gutter="12" class="tier-row">
|
||||||
<ElCol v-for="t in tierKeys" :key="'free-' + t" :span="8">
|
<ElCol v-for="t in tierKeys" :key="'free-' + t" :span="8">
|
||||||
<div class="tier-field">
|
<div class="tier-field">
|
||||||
@@ -130,36 +141,10 @@
|
|||||||
$t('page.weightTest.tierSumError', { sum: freeTierSum })
|
$t('page.weightTest.tierSumError', { sum: freeTierSum })
|
||||||
}}</div>
|
}}</div>
|
||||||
</template>
|
</template>
|
||||||
<ElFormItem :label="$t('page.weightTest.labelCwCount')" prop="free_s_count" required>
|
|
||||||
<ElSelect
|
|
||||||
v-model="form.free_s_count"
|
|
||||||
:placeholder="$t('page.weightTest.placeholderSelect')"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<ElOption v-for="c in countOptions" :key="c" :label="String(c)" :value="c" />
|
|
||||||
</ElSelect>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem :label="$t('page.weightTest.labelCcwCount')" prop="free_n_count" required>
|
|
||||||
<ElSelect
|
|
||||||
v-model="form.free_n_count"
|
|
||||||
:placeholder="$t('page.weightTest.placeholderSelect')"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<ElOption v-for="c in countOptions" :key="c" :label="String(c)" :value="c" />
|
|
||||||
</ElSelect>
|
|
||||||
</ElFormItem>
|
|
||||||
</div>
|
|
||||||
</ElForm>
|
</ElForm>
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<ElButton v-if="currentStep > 0" :disabled="running" @click="currentStep--">{{
|
|
||||||
$t('page.weightTest.btnPrev')
|
|
||||||
}}</ElButton>
|
|
||||||
<ElButton v-if="currentStep < 1" type="primary" :disabled="running" @click="currentStep++">{{
|
|
||||||
$t('page.weightTest.btnNext')
|
|
||||||
}}</ElButton>
|
|
||||||
<ElButton
|
<ElButton
|
||||||
v-if="currentStep === 1"
|
|
||||||
v-permission="'dice:reward:index:startWeightTest'"
|
v-permission="'dice:reward:index:startWeightTest'"
|
||||||
type="primary"
|
type="primary"
|
||||||
:loading="running"
|
:loading="running"
|
||||||
@@ -187,8 +172,6 @@
|
|||||||
const visible = defineModel<boolean>({ default: false })
|
const visible = defineModel<boolean>({ default: false })
|
||||||
const emit = defineEmits<{ (e: 'success'): void }>()
|
const emit = defineEmits<{ (e: 'success'): void }>()
|
||||||
|
|
||||||
const formRef = ref()
|
|
||||||
const currentStep = ref(0)
|
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
ante: 1,
|
ante: 1,
|
||||||
paid_lottery_config_id: undefined as number | undefined,
|
paid_lottery_config_id: undefined as number | undefined,
|
||||||
@@ -197,8 +180,8 @@
|
|||||||
free_tier_weights: { T1: 20, T2: 20, T3: 20, T4: 20, T5: 20 } as Record<string, number>,
|
free_tier_weights: { T1: 20, T2: 20, T3: 20, T4: 20, T5: 20 } as Record<string, number>,
|
||||||
paid_s_count: 100,
|
paid_s_count: 100,
|
||||||
paid_n_count: 100,
|
paid_n_count: 100,
|
||||||
free_s_count: 100,
|
kill_mode_enabled: false,
|
||||||
free_n_count: 100
|
test_safety_line: 5000
|
||||||
})
|
})
|
||||||
const lotteryOptions = ref<Array<{ id: number; name: string }>>([])
|
const lotteryOptions = ref<Array<{ id: number; name: string }>>([])
|
||||||
/** 付费抽奖券可选档位:name=default */
|
/** 付费抽奖券可选档位:name=default */
|
||||||
@@ -214,7 +197,6 @@
|
|||||||
|
|
||||||
function onClose() {
|
function onClose() {
|
||||||
running.value = false
|
running.value = false
|
||||||
currentStep.value = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPaidTier(t: string): string {
|
function getPaidTier(t: string): string {
|
||||||
@@ -255,12 +237,10 @@
|
|||||||
id: r.id,
|
id: r.id,
|
||||||
name: r.name
|
name: r.name
|
||||||
}))
|
}))
|
||||||
// 付费抽奖券默认使用 name=default
|
|
||||||
const normal = list.find((r: { name?: string }) => r.name === 'default')
|
const normal = list.find((r: { name?: string }) => r.name === 'default')
|
||||||
if (normal) {
|
if (normal) {
|
||||||
form.paid_lottery_config_id = normal.id
|
form.paid_lottery_config_id = normal.id
|
||||||
}
|
}
|
||||||
// 免费抽奖券默认使用 name=killScore;若无则默认选第一项
|
|
||||||
const kill = list.find((r: { name?: string }) => r.name === 'killScore')
|
const kill = list.find((r: { name?: string }) => r.name === 'killScore')
|
||||||
if (kill) {
|
if (kill) {
|
||||||
form.free_lottery_config_id = kill.id
|
form.free_lottery_config_id = kill.id
|
||||||
@@ -277,8 +257,11 @@
|
|||||||
ante: form.ante,
|
ante: form.ante,
|
||||||
paid_s_count: form.paid_s_count,
|
paid_s_count: form.paid_s_count,
|
||||||
paid_n_count: form.paid_n_count,
|
paid_n_count: form.paid_n_count,
|
||||||
free_s_count: form.free_s_count,
|
free_s_count: 0,
|
||||||
free_n_count: form.free_n_count
|
free_n_count: 0,
|
||||||
|
chain_free_mode: true,
|
||||||
|
kill_mode_enabled: form.kill_mode_enabled,
|
||||||
|
test_safety_line: form.test_safety_line
|
||||||
}
|
}
|
||||||
if (form.paid_lottery_config_id != null) {
|
if (form.paid_lottery_config_id != null) {
|
||||||
payload.paid_lottery_config_id = form.paid_lottery_config_id
|
payload.paid_lottery_config_id = form.paid_lottery_config_id
|
||||||
@@ -298,8 +281,12 @@
|
|||||||
ElMessage.warning(t('page.weightTest.warnAnte'))
|
ElMessage.warning(t('page.weightTest.warnAnte'))
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (form.paid_s_count + form.paid_n_count + form.free_s_count + form.free_n_count <= 0) {
|
if (form.paid_s_count + form.paid_n_count <= 0) {
|
||||||
ElMessage.warning(t('page.weightTest.warnTotalSpins'))
|
ElMessage.warning(t('page.weightTest.warnPaidSpins'))
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (form.kill_mode_enabled && (form.test_safety_line == null || form.test_safety_line < 0)) {
|
||||||
|
ElMessage.warning(t('page.weightTest.warnTestSafetyLine'))
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
const needPaidTier = form.paid_lottery_config_id == null
|
const needPaidTier = form.paid_lottery_config_id == null
|
||||||
@@ -351,28 +338,22 @@
|
|||||||
onClose()
|
onClose()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 切换到免费步骤时,若当前选中 id 不在免费档位列表中,则重置为第一个 killScore 的选项,避免显示错误
|
|
||||||
watch(currentStep, (step) => {
|
|
||||||
if (step === 1) {
|
|
||||||
const freeOpts = freeLotteryOptions.value
|
|
||||||
const id = form.free_lottery_config_id
|
|
||||||
if (freeOpts.length && (id == null || !freeOpts.some((o) => o.id === id))) {
|
|
||||||
form.free_lottery_config_id = freeOpts[0].id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.weight-test-tip {
|
.weight-test-tip {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
.steps-wrap {
|
.chain-tip {
|
||||||
margin-bottom: 16px;
|
margin-top: -8px;
|
||||||
}
|
}
|
||||||
.step-panel {
|
.section-title {
|
||||||
min-height: 200px;
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--el-text-color-primary);
|
||||||
|
margin: 8px 0 12px;
|
||||||
|
padding-bottom: 6px;
|
||||||
|
border-bottom: 1px solid var(--el-border-color-lighter);
|
||||||
}
|
}
|
||||||
.tier-label {
|
.tier-label {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
|||||||
@@ -39,12 +39,21 @@
|
|||||||
size="default"
|
size="default"
|
||||||
class="config-table"
|
class="config-table"
|
||||||
>
|
>
|
||||||
<ElTableColumn :label="$t('page.configPage.colId')" prop="id" width="60" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colId')"
|
||||||
|
prop="id"
|
||||||
|
width="60"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span>{{ row.id }}</span>
|
<span>{{ row.id }}</span>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('page.configPage.colDicePoints')" min-width="100" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colDicePoints')"
|
||||||
|
min-width="100"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElInputNumber
|
<ElInputNumber
|
||||||
v-model="row.grid_number"
|
v-model="row.grid_number"
|
||||||
@@ -56,7 +65,11 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('page.configPage.colDisplayText')" min-width="100" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colDisplayText')"
|
||||||
|
min-width="100"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElInput
|
<ElInput
|
||||||
v-model="row.ui_text"
|
v-model="row.ui_text"
|
||||||
@@ -65,7 +78,11 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('page.configPage.colDisplayTextEn')" min-width="120" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colDisplayTextEn')"
|
||||||
|
min-width="120"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElInput
|
<ElInput
|
||||||
v-model="row.ui_text_en"
|
v-model="row.ui_text_en"
|
||||||
@@ -74,16 +91,31 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('page.configPage.colRealEv')" min-width="110" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colRealEv')"
|
||||||
|
min-width="110"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElInputNumber
|
<ElInputNumber
|
||||||
v-model="row.real_ev"
|
v-model="row.real_ev"
|
||||||
|
@change="handleRealEvChange(row)"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
size="small"
|
size="small"
|
||||||
|
:step="1"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colRealReward')"
|
||||||
|
min-width="130"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span>{{ formatMoney2(calcRealReward(row.real_ev)) }}</span>
|
||||||
|
</template>
|
||||||
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('page.configPage.colTier')" width="100" align="center">
|
<ElTableColumn :label="$t('page.configPage.colTier')" width="100" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElSelect
|
<ElSelect
|
||||||
@@ -101,7 +133,11 @@
|
|||||||
</ElSelect>
|
</ElSelect>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('page.configPage.colRemark')" min-width="140" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colRemark')"
|
||||||
|
min-width="140"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElInput
|
<ElInput
|
||||||
v-model="row.remark"
|
v-model="row.remark"
|
||||||
@@ -135,12 +171,20 @@
|
|||||||
size="default"
|
size="default"
|
||||||
class="config-table bigwin-table"
|
class="config-table bigwin-table"
|
||||||
>
|
>
|
||||||
<ElTableColumn :label="$t('page.configPage.colBigwinPoints')" width="100" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colBigwinPoints')"
|
||||||
|
width="100"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span class="readonly-value">{{ row.grid_number }}</span>
|
<span class="readonly-value">{{ row.grid_number }}</span>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('page.configPage.colDisplayInfo')" min-width="140" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colDisplayInfo')"
|
||||||
|
min-width="140"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElInput
|
<ElInput
|
||||||
v-model="row.ui_text"
|
v-model="row.ui_text"
|
||||||
@@ -149,7 +193,11 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('page.configPage.colDisplayInfoEn')" min-width="160" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colDisplayInfoEn')"
|
||||||
|
min-width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElInput
|
<ElInput
|
||||||
v-model="row.ui_text_en"
|
v-model="row.ui_text_en"
|
||||||
@@ -158,17 +206,27 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('page.configPage.colRealPrize')" min-width="120" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colRealPrize')"
|
||||||
|
min-width="120"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElInputNumber
|
<ElInputNumber
|
||||||
v-model="row.real_ev"
|
v-model="row.real_ev"
|
||||||
|
@change="handleRealEvChange(row)"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
size="small"
|
size="small"
|
||||||
|
:step="1"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('page.configPage.colRemark')" min-width="140" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colRemark')"
|
||||||
|
min-width="140"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElInput
|
<ElInput
|
||||||
v-model="row.remark"
|
v-model="row.remark"
|
||||||
@@ -177,7 +235,11 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
<ElTableColumn :label="$t('page.configPage.colWeightRange')" min-width="220" align="center">
|
<ElTableColumn
|
||||||
|
:label="$t('page.configPage.colWeightRange')"
|
||||||
|
min-width="220"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="weight-cell">
|
<div class="weight-cell">
|
||||||
<ElSlider
|
<ElSlider
|
||||||
@@ -481,6 +543,31 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function calcRealReward(realEv: unknown): number {
|
||||||
|
const n = typeof realEv === 'number' && !Number.isNaN(realEv) ? realEv : Number(realEv)
|
||||||
|
if (Number.isNaN(n)) {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
return n - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleRealEvChange(row: IndexRow) {
|
||||||
|
const n =
|
||||||
|
typeof row.real_ev === 'number' && !Number.isNaN(row.real_ev)
|
||||||
|
? row.real_ev
|
||||||
|
: Number(row.real_ev)
|
||||||
|
const text = Number.isNaN(n) ? '' : Number(n).toFixed(2)
|
||||||
|
row.ui_text = text
|
||||||
|
row.ui_text_en = text
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatMoney2(val: unknown): string {
|
||||||
|
if (val === '' || val === null || val === undefined) return '-'
|
||||||
|
const n = typeof val === 'number' ? val : Number(val)
|
||||||
|
if (!Number.isFinite(n)) return '-'
|
||||||
|
return n.toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
async function handleCreateRewardReference() {
|
async function handleCreateRewardReference() {
|
||||||
try {
|
try {
|
||||||
await ElMessageBox.confirm(
|
await ElMessageBox.confirm(
|
||||||
|
|||||||
@@ -22,7 +22,11 @@
|
|||||||
<el-input v-model="formData.ui_text_en" :placeholder="$t('page.form.placeholderUiTextEn')" />
|
<el-input v-model="formData.ui_text_en" :placeholder="$t('page.form.placeholderUiTextEn')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('page.form.labelRealEv')" prop="real_ev">
|
<el-form-item :label="$t('page.form.labelRealEv')" prop="real_ev">
|
||||||
<el-input-number v-model="formData.real_ev" :placeholder="$t('page.form.placeholderRealEv')" />
|
<el-input-number
|
||||||
|
v-model="formData.real_ev"
|
||||||
|
:placeholder="$t('page.form.placeholderRealEv')"
|
||||||
|
@change="handleRealEvChange"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('page.form.labelTier')" prop="tier">
|
<el-form-item :label="$t('page.form.labelTier')" prop="tier">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -237,6 +241,16 @@
|
|||||||
console.log('表单验证失败:', error)
|
console.log('表单验证失败:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleRealEvChange = () => {
|
||||||
|
const n =
|
||||||
|
typeof formData.real_ev === 'number' && !Number.isNaN(formData.real_ev)
|
||||||
|
? formData.real_ev
|
||||||
|
: Number(formData.real_ev)
|
||||||
|
const text = Number.isNaN(n) ? '' : String(n)
|
||||||
|
formData.ui_text = text
|
||||||
|
formData.ui_text_en = text
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ export interface TierRealEvStandards {
|
|||||||
T5: number
|
T5: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 默认标准(与常见业务约定一致:100<T1<500,等) */
|
/** 默认标准(与规则弹窗说明一致) */
|
||||||
export const DEFAULT_TIER_REAL_EV_STANDARDS: TierRealEvStandards = {
|
export const DEFAULT_TIER_REAL_EV_STANDARDS: TierRealEvStandards = {
|
||||||
T1: 400,
|
T1: 3,
|
||||||
T2: 50,
|
T2: 1.5,
|
||||||
T3: -80,
|
T3: 0.5,
|
||||||
T4: -140,
|
T4: -0.4,
|
||||||
T5: 0
|
T5: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,16 +66,16 @@ export const DEFAULT_TIER_REAL_EV_STANDARDS: TierRealEvStandards = {
|
|||||||
* 校验档位与 real_ev 区间是否一致;通过返回 null,否则返回 i18n 键名(不含 page.configPage. 前缀)
|
* 校验档位与 real_ev 区间是否一致;通过返回 null,否则返回 i18n 键名(不含 page.configPage. 前缀)
|
||||||
*/
|
*/
|
||||||
export function validateTierRealEvStandards(s: TierRealEvStandards): string | null {
|
export function validateTierRealEvStandards(s: TierRealEvStandards): string | null {
|
||||||
if (!Number.isFinite(s.T1) || !(s.T1 > 100 && s.T1 < 500)) {
|
if (!Number.isFinite(s.T1) || !(s.T1 > 2)) {
|
||||||
return 'ruleGenInvalidT1RealEv'
|
return 'ruleGenInvalidT1RealEv'
|
||||||
}
|
}
|
||||||
if (!Number.isFinite(s.T2) || !(s.T2 > 0 && s.T2 < 100)) {
|
if (!Number.isFinite(s.T2) || !(s.T2 > 1 && s.T2 < 2)) {
|
||||||
return 'ruleGenInvalidT2RealEv'
|
return 'ruleGenInvalidT2RealEv'
|
||||||
}
|
}
|
||||||
if (!Number.isFinite(s.T3) || !(-100 < s.T3 && s.T3 < 0)) {
|
if (!Number.isFinite(s.T3) || !(s.T3 > 0 && s.T3 < 1)) {
|
||||||
return 'ruleGenInvalidT3RealEv'
|
return 'ruleGenInvalidT3RealEv'
|
||||||
}
|
}
|
||||||
if (!Number.isFinite(s.T4) || !(s.T4 < -100)) {
|
if (!Number.isFinite(s.T4) || !(s.T4 < 0)) {
|
||||||
return 'ruleGenInvalidT4RealEv'
|
return 'ruleGenInvalidT4RealEv'
|
||||||
}
|
}
|
||||||
if (!Number.isFinite(s.T5) || s.T5 !== 0) {
|
if (!Number.isFinite(s.T5) || s.T5 !== 0) {
|
||||||
@@ -271,10 +271,21 @@ export function generateTiers(input: GenerateTierInput): GenerateTierResult {
|
|||||||
return { ok: false, message: '在当前盘面与约束下未找到可行解,请调整 T1/T4/T5 固定条数或放宽 T2 下限后重试' }
|
return { ok: false, message: '在当前盘面与约束下未找到可行解,请调整 T1/T4/T5 固定条数或放宽 T2 下限后重试' }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 展示文案:100 + 真实结算(中英文相同);T5 不使用 */
|
function uiTextByTierWhenStandards(
|
||||||
function uiTextFromRealEvPlus100(realEv: number): { ui_text: string; ui_text_en: string } {
|
tier: IndexTier,
|
||||||
const s = String(100 + realEv)
|
realEv: number
|
||||||
return { ui_text: s, ui_text_en: s }
|
): { ui_text: string; ui_text_en: string } {
|
||||||
|
if (tier === 'T5') {
|
||||||
|
return { ui_text: '再来一次', ui_text_en: 'Once again' }
|
||||||
|
}
|
||||||
|
const value = Number.isFinite(realEv) ? realEv.toFixed(2) : String(realEv)
|
||||||
|
return { ui_text: value, ui_text_en: value }
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 展示文案:直接使用真实结算值(中英文相同) */
|
||||||
|
function uiTextFromRealEv(realEv: number): { ui_text: string; ui_text_en: string } {
|
||||||
|
const value = Number.isFinite(realEv) ? realEv.toFixed(2) : String(realEv)
|
||||||
|
return { ui_text: value, ui_text_en: value }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -315,32 +326,33 @@ export function buildRowsFromTiers(
|
|||||||
if (standards !== undefined) {
|
if (standards !== undefined) {
|
||||||
if (tier === 'T1') {
|
if (tier === 'T1') {
|
||||||
real_ev = standards.T1
|
real_ev = standards.T1
|
||||||
const f = uiTextFromRealEvPlus100(real_ev)
|
const f = uiTextByTierWhenStandards(tier, real_ev)
|
||||||
ui_text = f.ui_text
|
ui_text = f.ui_text
|
||||||
ui_text_en = f.ui_text_en
|
ui_text_en = f.ui_text_en
|
||||||
remark = '大奖格'
|
remark = '大奖格'
|
||||||
} else if (tier === 'T2') {
|
} else if (tier === 'T2') {
|
||||||
real_ev = standards.T2
|
real_ev = standards.T2
|
||||||
const f = uiTextFromRealEvPlus100(real_ev)
|
const f = uiTextByTierWhenStandards(tier, real_ev)
|
||||||
ui_text = f.ui_text
|
ui_text = f.ui_text
|
||||||
ui_text_en = f.ui_text_en
|
ui_text_en = f.ui_text_en
|
||||||
remark = standards.T2 <= 1 ? '完美回本' : '小赚'
|
remark = standards.T2 <= 1 ? '完美回本' : '小赚'
|
||||||
} else if (tier === 'T3') {
|
} else if (tier === 'T3') {
|
||||||
real_ev = standards.T3
|
real_ev = standards.T3
|
||||||
const f = uiTextFromRealEvPlus100(real_ev)
|
const f = uiTextByTierWhenStandards(tier, real_ev)
|
||||||
ui_text = f.ui_text
|
ui_text = f.ui_text
|
||||||
ui_text_en = f.ui_text_en
|
ui_text_en = f.ui_text_en
|
||||||
remark = '抽水'
|
remark = '抽水'
|
||||||
} else if (tier === 'T4') {
|
} else if (tier === 'T4') {
|
||||||
real_ev = standards.T4
|
real_ev = standards.T4
|
||||||
const f = uiTextFromRealEvPlus100(real_ev)
|
const f = uiTextByTierWhenStandards(tier, real_ev)
|
||||||
ui_text = f.ui_text
|
ui_text = f.ui_text
|
||||||
ui_text_en = f.ui_text_en
|
ui_text_en = f.ui_text_en
|
||||||
remark = '惩罚'
|
remark = '惩罚'
|
||||||
} else {
|
} else {
|
||||||
real_ev = standards.T5
|
real_ev = standards.T5
|
||||||
ui_text = '再来一次'
|
const f = uiTextByTierWhenStandards(tier, real_ev)
|
||||||
ui_text_en = 'Once again'
|
ui_text = f.ui_text
|
||||||
|
ui_text_en = f.ui_text_en
|
||||||
remark = '前端需要在播放一次动画(特殊)'
|
remark = '前端需要在播放一次动画(特殊)'
|
||||||
}
|
}
|
||||||
} else if (tier === 'T1') {
|
} else if (tier === 'T1') {
|
||||||
@@ -348,7 +360,7 @@ export function buildRowsFromTiers(
|
|||||||
if (real_ev >= 500) {
|
if (real_ev >= 500) {
|
||||||
real_ev = 498
|
real_ev = 498
|
||||||
}
|
}
|
||||||
const f = uiTextFromRealEvPlus100(real_ev)
|
const f = uiTextFromRealEv(real_ev)
|
||||||
ui_text = f.ui_text
|
ui_text = f.ui_text
|
||||||
ui_text_en = f.ui_text_en
|
ui_text_en = f.ui_text_en
|
||||||
remark = '大奖格'
|
remark = '大奖格'
|
||||||
@@ -363,26 +375,27 @@ export function buildRowsFromTiers(
|
|||||||
}
|
}
|
||||||
remark = '小赚'
|
remark = '小赚'
|
||||||
}
|
}
|
||||||
const f = uiTextFromRealEvPlus100(real_ev)
|
const f = uiTextFromRealEv(real_ev)
|
||||||
ui_text = f.ui_text
|
ui_text = f.ui_text
|
||||||
ui_text_en = f.ui_text_en
|
ui_text_en = f.ui_text_en
|
||||||
} else if (tier === 'T3') {
|
} else if (tier === 'T3') {
|
||||||
real_ev = -72 - (id % 15)
|
real_ev = -72 - (id % 15)
|
||||||
const f = uiTextFromRealEvPlus100(real_ev)
|
const f = uiTextFromRealEv(real_ev)
|
||||||
ui_text = f.ui_text
|
ui_text = f.ui_text
|
||||||
ui_text_en = f.ui_text_en
|
ui_text_en = f.ui_text_en
|
||||||
remark = '抽水'
|
remark = '抽水'
|
||||||
} else if (tier === 'T4') {
|
} else if (tier === 'T4') {
|
||||||
t4Seq++
|
t4Seq++
|
||||||
real_ev = -101 - t4Seq * 15
|
real_ev = -101 - t4Seq * 15
|
||||||
const f = uiTextFromRealEvPlus100(real_ev)
|
const f = uiTextFromRealEv(real_ev)
|
||||||
ui_text = f.ui_text
|
ui_text = f.ui_text
|
||||||
ui_text_en = f.ui_text_en
|
ui_text_en = f.ui_text_en
|
||||||
remark = '惩罚'
|
remark = '惩罚'
|
||||||
} else {
|
} else {
|
||||||
real_ev = 0
|
real_ev = 0
|
||||||
ui_text = '再来一次'
|
const f = uiTextFromRealEv(real_ev)
|
||||||
ui_text_en = 'Once again'
|
ui_text = f.ui_text
|
||||||
|
ui_text_en = f.ui_text_en
|
||||||
remark = '前端需要在播放一次动画(特殊)'
|
remark = '前端需要在播放一次动画(特殊)'
|
||||||
}
|
}
|
||||||
rows.push({
|
rows.push({
|
||||||
|
|||||||
@@ -40,19 +40,18 @@
|
|||||||
<template #status="{ row }">
|
<template #status="{ row }">
|
||||||
<span>{{ formatStatus(row.status) }}</span>
|
<span>{{ formatStatus(row.status) }}</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- 付费抽取:顺时针、逆时针抽取次数(兼容旧数据用 s_count/n_count) -->
|
<!-- 付费抽取:顺时针、逆时针抽取次数 -->
|
||||||
<template #paid_draw="{ row }">
|
<template #paid_draw="{ row }">
|
||||||
<span
|
<span
|
||||||
>{{ $t('page.table.clockwiseAbbr') }} {{ getPaidS(row) }} /
|
>{{ $t('page.table.clockwiseAbbr') }} {{ getPaidS(row) }} /
|
||||||
{{ $t('page.table.counterclockwiseAbbr') }} {{ getPaidN(row) }}</span
|
{{ $t('page.table.counterclockwiseAbbr') }} {{ getPaidN(row) }}</span
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
<!-- 免费抽取:顺时针、逆时针抽取次数 -->
|
<template #chain_mode="{ row }">
|
||||||
<template #free_draw="{ row }">
|
<span>{{ formatChainMode(row) }}</span>
|
||||||
<span
|
</template>
|
||||||
>{{ $t('page.table.clockwiseAbbr') }} {{ row.free_s_count ?? 0 }} /
|
<template #total_draw="{ row }">
|
||||||
{{ $t('page.table.counterclockwiseAbbr') }} {{ row.free_n_count ?? 0 }}</span
|
<span>{{ formatTotalDraw(row) }}</span>
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
<!-- 平台赚取金额 -->
|
<!-- 平台赚取金额 -->
|
||||||
<template #platform_profit="{ row }">
|
<template #platform_profit="{ row }">
|
||||||
@@ -136,16 +135,12 @@
|
|||||||
return t('page.detail.dash')
|
return t('page.detail.dash')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 付费抽取次数(兼容旧数据:无 paid_s_count 时用 s_count)
|
// 付费抽取次数
|
||||||
function getPaidS(row: Record<string, any>): number {
|
function getPaidS(row: Record<string, any>): number {
|
||||||
const v = row.paid_s_count
|
return Number(row.paid_s_count ?? 0)
|
||||||
if (v !== undefined && v !== null && (Number(v) || 0) > 0) return Number(v)
|
|
||||||
return Number(row.s_count ?? 0)
|
|
||||||
}
|
}
|
||||||
function getPaidN(row: Record<string, any>): number {
|
function getPaidN(row: Record<string, any>): number {
|
||||||
const v = row.paid_n_count
|
return Number(row.paid_n_count ?? 0)
|
||||||
if (v !== undefined && v !== null && (Number(v) || 0) > 0) return Number(v)
|
|
||||||
return Number(row.n_count ?? 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 平台赚取金额展示(未完成或空显示 —)
|
// 平台赚取金额展示(未完成或空显示 —)
|
||||||
@@ -154,7 +149,32 @@
|
|||||||
if (v === null || v === undefined || v === '') return dash
|
if (v === null || v === undefined || v === '') return dash
|
||||||
const n = Number(v)
|
const n = Number(v)
|
||||||
if (Number.isNaN(n)) return dash
|
if (Number.isNaN(n)) return dash
|
||||||
return String(n)
|
return n.toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 链式再来一次:1=是(新库字段),JSON 旧数据用 tier_weights_snapshot.chain_free_mode */
|
||||||
|
function formatChainMode(row: Record<string, any>): string {
|
||||||
|
const v = row.chain_free_mode
|
||||||
|
if (v === 1 || v === '1' || v === true) return t('page.table.chainModeYes')
|
||||||
|
const snap = row.tier_weights_snapshot
|
||||||
|
if (snap && typeof snap === 'object' && (snap as { chain_free_mode?: boolean }).chain_free_mode) {
|
||||||
|
return t('page.table.chainModeYes')
|
||||||
|
}
|
||||||
|
return t('page.table.chainModeNo')
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 总抽奖次数:仅完成态写最终值;测试中显示已完成次数 */
|
||||||
|
function formatTotalDraw(row: Record<string, any>): string {
|
||||||
|
const status = Number(row.status)
|
||||||
|
const done = Number(row.total_play_count ?? 0)
|
||||||
|
const over = Number(row.over_play_count ?? 0)
|
||||||
|
if (status === 1) {
|
||||||
|
return String(done)
|
||||||
|
}
|
||||||
|
if (status === -1) {
|
||||||
|
return over > 0 ? t('page.table.progressFailed', { over }) : t('page.detail.dash')
|
||||||
|
}
|
||||||
|
return t('page.table.progressDraws', { over })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格配置
|
// 表格配置
|
||||||
@@ -193,12 +213,30 @@
|
|||||||
useSlot: true
|
useSlot: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'free_draw',
|
prop: 'chain_mode',
|
||||||
label: 'page.table.freeDraw',
|
label: 'page.table.chainMode',
|
||||||
width: 160,
|
width: 110,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
useSlot: true
|
useSlot: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'paid_planned_spins',
|
||||||
|
label: 'page.table.paidPlannedSpins',
|
||||||
|
width: 120,
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'ante',
|
||||||
|
label: 'page.table.ante',
|
||||||
|
width: 90,
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'play_again_count',
|
||||||
|
label: 'page.table.playAgainCount',
|
||||||
|
width: 120,
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'platform_profit',
|
prop: 'platform_profit',
|
||||||
label: 'page.table.platformProfit',
|
label: 'page.table.platformProfit',
|
||||||
@@ -206,7 +244,13 @@
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
useSlot: true
|
useSlot: true
|
||||||
},
|
},
|
||||||
{ prop: 'total_play_count', label: 'page.table.totalDrawCount', width: 110, align: 'center' },
|
{
|
||||||
|
prop: 'total_draw',
|
||||||
|
label: 'page.table.totalDrawCount',
|
||||||
|
width: 140,
|
||||||
|
align: 'center',
|
||||||
|
useSlot: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'admin_name',
|
prop: 'admin_name',
|
||||||
label: 'page.table.createdBy',
|
label: 'page.table.createdBy',
|
||||||
|
|||||||
@@ -14,9 +14,15 @@
|
|||||||
<el-descriptions-item :label="$t('page.detail.recordId')">
|
<el-descriptions-item :label="$t('page.detail.recordId')">
|
||||||
{{ record.id }}
|
{{ record.id }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item :label="$t('page.detail.testCount')"
|
<el-descriptions-item :label="$t('page.detail.chainModeLabel')">
|
||||||
>{{ record.test_count }}{{ $t('page.detail.testCountSuffix') }}</el-descriptions-item
|
{{ formatChainModeDetail(record) }}
|
||||||
>
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :label="$t('page.detail.paidPlannedSpins')">
|
||||||
|
{{ record.paid_planned_spins ?? $t('page.detail.dash') }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item :label="$t('page.detail.testCount')">
|
||||||
|
{{ formatTestCountDisplay(record) }}
|
||||||
|
</el-descriptions-item>
|
||||||
<el-descriptions-item :label="$t('page.detail.createTime')">
|
<el-descriptions-item :label="$t('page.detail.createTime')">
|
||||||
{{ record.create_time || $t('page.detail.dash') }}
|
{{ record.create_time || $t('page.detail.dash') }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
@@ -231,6 +237,11 @@
|
|||||||
interface RecordRow {
|
interface RecordRow {
|
||||||
id?: number
|
id?: number
|
||||||
test_count?: number
|
test_count?: number
|
||||||
|
total_play_count?: number
|
||||||
|
status?: number
|
||||||
|
over_play_count?: number
|
||||||
|
chain_free_mode?: number | boolean | string
|
||||||
|
paid_planned_spins?: number
|
||||||
create_time?: string
|
create_time?: string
|
||||||
admin_id?: number | null
|
admin_id?: number | null
|
||||||
admin_name?: string
|
admin_name?: string
|
||||||
@@ -238,7 +249,6 @@
|
|||||||
paid_lottery_config_id?: number | null
|
paid_lottery_config_id?: number | null
|
||||||
free_lottery_config_id?: number | null
|
free_lottery_config_id?: number | null
|
||||||
bigwin_weight?: Record<string, number> | Array<[number, number]> | null
|
bigwin_weight?: Record<string, number> | Array<[number, number]> | null
|
||||||
// 新结构:{ paid: {T1..T5}, free: {T1..T5} },兼容旧结构直接是 {T1..T5}
|
|
||||||
tier_weights_snapshot?:
|
tier_weights_snapshot?:
|
||||||
| {
|
| {
|
||||||
paid?: Record<string, number>
|
paid?: Record<string, number>
|
||||||
@@ -257,6 +267,32 @@
|
|||||||
result_counts?: Record<string, number>
|
result_counts?: Record<string, number>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatChainModeDetail(record: RecordRow | null): string {
|
||||||
|
if (!record) return t('page.detail.dash')
|
||||||
|
const v = record.chain_free_mode
|
||||||
|
if (v === 1 || v === '1' || v === true) return t('page.table.chainModeYes')
|
||||||
|
const snap = record.tier_weights_snapshot
|
||||||
|
if (snap && typeof snap === 'object' && (snap as { chain_free_mode?: boolean }).chain_free_mode) {
|
||||||
|
return t('page.table.chainModeYes')
|
||||||
|
}
|
||||||
|
return t('page.table.chainModeNo')
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatTestCountDisplay(record: RecordRow | null): string {
|
||||||
|
if (!record) return t('page.detail.dash')
|
||||||
|
const status = Number(record.status)
|
||||||
|
if (status === 1) {
|
||||||
|
const n = record.test_count ?? record.total_play_count
|
||||||
|
return `${n ?? 0}${t('page.detail.testCountSuffix')}`
|
||||||
|
}
|
||||||
|
if (status === -1) {
|
||||||
|
const over = Number(record.over_play_count ?? 0)
|
||||||
|
return over > 0 ? t('page.detail.testCountFailed', { over }) : t('page.detail.dash')
|
||||||
|
}
|
||||||
|
const over = Number(record.over_play_count ?? 0)
|
||||||
|
return t('page.detail.testCountProgress', { over })
|
||||||
|
}
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
modelValue: boolean
|
modelValue: boolean
|
||||||
record: RecordRow | null
|
record: RecordRow | null
|
||||||
|
|||||||
@@ -8,6 +8,32 @@
|
|||||||
@search="handleSearch"
|
@search="handleSearch"
|
||||||
@expand="handleExpand"
|
@expand="handleExpand"
|
||||||
>
|
>
|
||||||
|
<el-col v-bind="setSpan(6)">
|
||||||
|
<el-form-item :label="$t('page.search.paidPlannedSpins')" prop="paid_planned_spins">
|
||||||
|
<el-input-number
|
||||||
|
v-model="formData.paid_planned_spins"
|
||||||
|
:placeholder="$t('table.searchBar.all')"
|
||||||
|
:min="0"
|
||||||
|
:precision="0"
|
||||||
|
:step="1"
|
||||||
|
controls-position="right"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col v-bind="setSpan(6)">
|
||||||
|
<el-form-item :label="$t('page.search.ante')" prop="ante">
|
||||||
|
<el-input-number
|
||||||
|
v-model="formData.ante"
|
||||||
|
:placeholder="$t('table.searchBar.all')"
|
||||||
|
:min="1"
|
||||||
|
:precision="0"
|
||||||
|
:step="1"
|
||||||
|
controls-position="right"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</sa-search-bar>
|
</sa-search-bar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -143,6 +143,7 @@
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { useTerminalStore, TaskStatus } from '../store/terminal'
|
import { useTerminalStore, TaskStatus } from '../store/terminal'
|
||||||
|
import { $t } from '@/locales'
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'success'): void
|
(e: 'success'): void
|
||||||
@@ -157,51 +158,51 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const webBuild = () => {
|
const webBuild = () => {
|
||||||
ElMessageBox.confirm('确认重新打包前端并发布项目吗?', '前端打包发布', {
|
ElMessageBox.confirm($t('uiMsg.saipackageWebBuildConfirm'), $t('uiMsg.saipackageWebBuildTitle'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
terminal.addNodeTask('web-build', '', () => {
|
terminal.addNodeTask('web-build', '', () => {
|
||||||
ElMessage.success('前端打包发布成功')
|
ElMessage.success($t('uiMsg.saipackageWebBuildSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleFronted = () => {
|
const handleFronted = () => {
|
||||||
ElMessageBox.confirm('确认更新前端Node依赖吗?', '前端依赖更新', {
|
ElMessageBox.confirm($t('uiMsg.saipackageFrontendDepsConfirm'), $t('uiMsg.saipackageFrontendDepsTitle'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
terminal.addNodeTask('web-install', '', () => {
|
terminal.addNodeTask('web-install', '', () => {
|
||||||
ElMessage.success('前端依赖更新成功')
|
ElMessage.success($t('uiMsg.saipackageFrontendDepsSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleBackend = () => {
|
const handleBackend = () => {
|
||||||
ElMessageBox.confirm('确认更新后端composer包吗?', 'composer包更新', {
|
ElMessageBox.confirm($t('uiMsg.saipackageComposerConfirm'), $t('uiMsg.saipackageComposerTitle'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
terminal.addTask('composer.update', '', () => {
|
terminal.addTask('composer.update', '', () => {
|
||||||
ElMessage.success('composer包更新成功')
|
ElMessage.success($t('uiMsg.saipackageComposerSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const frontInstall = (extend = '') => {
|
const frontInstall = (extend = '') => {
|
||||||
terminal.addNodeTask('web-install', extend, () => {
|
terminal.addNodeTask('web-install', extend, () => {
|
||||||
ElMessage.success('前端依赖更新成功')
|
ElMessage.success($t('uiMsg.saipackageFrontendDepsSuccess'))
|
||||||
emit('success')
|
emit('success')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const backendInstall = (extend = '') => {
|
const backendInstall = (extend = '') => {
|
||||||
terminal.addTask('composer.update', extend, () => {
|
terminal.addTask('composer.update', extend, () => {
|
||||||
ElMessage.success('composer包更新成功')
|
ElMessage.success($t('uiMsg.saipackageComposerSuccess'))
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
emit('success')
|
emit('success')
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|||||||
@@ -186,6 +186,7 @@
|
|||||||
import api from '@/api/safeguard/server'
|
import api from '@/api/safeguard/server'
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
@@ -219,16 +220,16 @@
|
|||||||
*/
|
*/
|
||||||
const handleClearCache = (tag: string): void => {
|
const handleClearCache = (tag: string): void => {
|
||||||
if (!tag) {
|
if (!tag) {
|
||||||
ElMessage.warning('请选择要清理的缓存')
|
ElMessage.warning($t('uiMsg.clearCacheSelect'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(`确定要清理标签:【${tag}】的缓存吗?`, '清理选中缓存', {
|
ElMessageBox.confirm($t('uiMsg.clearCacheConfirmByTag', { tag }), $t('uiMsg.clearCacheTitle'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
api.clear({ tag }).then(() => {
|
api.clear({ tag }).then(() => {
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success($t('uiMsg.operationSuccess'))
|
||||||
updateCacheInfo()
|
updateCacheInfo()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -84,7 +84,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import api from '@/api/safeguard/database'
|
import api from '@/api/safeguard/database'
|
||||||
import TableSearch from './modules/table-search.vue'
|
import TableSearch from './modules/table-search.vue'
|
||||||
import TableDialog from './modules/table-dialog.vue'
|
import TableDialog from './modules/table-dialog.vue'
|
||||||
@@ -126,7 +127,12 @@
|
|||||||
columnsFactory: () => [
|
columnsFactory: () => [
|
||||||
{ type: 'selection' },
|
{ type: 'selection' },
|
||||||
{ prop: 'name', label: 'page.table.tableName', minWidth: 200 },
|
{ prop: 'name', label: 'page.table.tableName', minWidth: 200 },
|
||||||
{ prop: 'comment', label: 'page.table.tableComment', minWidth: 150, showOverflowTooltip: true },
|
{
|
||||||
|
prop: 'comment',
|
||||||
|
label: 'page.table.tableComment',
|
||||||
|
minWidth: 150,
|
||||||
|
showOverflowTooltip: true
|
||||||
|
},
|
||||||
{ prop: 'engine', label: 'page.table.tableEngine', width: 120 },
|
{ prop: 'engine', label: 'page.table.tableEngine', width: 120 },
|
||||||
{ prop: 'update_time', label: 'page.table.updateTime', width: 180, sortable: true },
|
{ prop: 'update_time', label: 'page.table.updateTime', width: 180, sortable: true },
|
||||||
{ prop: 'rows', label: 'page.table.totalRows', width: 120 },
|
{ prop: 'rows', label: 'page.table.totalRows', width: 120 },
|
||||||
@@ -134,7 +140,13 @@
|
|||||||
{ prop: 'data_length', label: 'page.table.dataSize', width: 120 },
|
{ prop: 'data_length', label: 'page.table.dataSize', width: 120 },
|
||||||
{ prop: 'collation', label: 'page.table.collation', width: 180 },
|
{ prop: 'collation', label: 'page.table.collation', width: 180 },
|
||||||
{ prop: 'create_time', label: 'page.table.createTime', width: 180, sortable: true },
|
{ prop: 'create_time', label: 'page.table.createTime', width: 180, sortable: true },
|
||||||
{ prop: 'operation', label: 'table.actions.operation', width: 100, fixed: 'right', useSlot: true }
|
{
|
||||||
|
prop: 'operation',
|
||||||
|
label: 'table.actions.operation',
|
||||||
|
width: 100,
|
||||||
|
fixed: 'right',
|
||||||
|
useSlot: true
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -167,20 +179,20 @@
|
|||||||
*/
|
*/
|
||||||
const handleOptimizeRows = (): void => {
|
const handleOptimizeRows = (): void => {
|
||||||
if (selectedRows.value.length === 0) {
|
if (selectedRows.value.length === 0) {
|
||||||
ElMessage.warning('请选择要优化的行')
|
ElMessage.warning($t('page.ui.selectRowsToOptimize'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
`确定要优化选中的 ${selectedRows.value.length} 条数据吗?`,
|
$t('page.ui.optimizeConfirm', { n: selectedRows.value.length }),
|
||||||
'优化选中数据',
|
$t('page.ui.optimizeTitle'),
|
||||||
{
|
{
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
api.optimize({ tables: selectedRows.value.map((row) => row.name) }).then(() => {
|
api.optimize({ tables: selectedRows.value.map((row) => row.name) }).then(() => {
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success($t('uiMsg.operationSuccess'))
|
||||||
refreshData()
|
refreshData()
|
||||||
selectedRows.value = []
|
selectedRows.value = []
|
||||||
})
|
})
|
||||||
@@ -192,20 +204,20 @@
|
|||||||
*/
|
*/
|
||||||
const handleFragmentRows = (): void => {
|
const handleFragmentRows = (): void => {
|
||||||
if (selectedRows.value.length === 0) {
|
if (selectedRows.value.length === 0) {
|
||||||
ElMessage.warning('请选择要清理碎片的行')
|
ElMessage.warning($t('page.ui.selectRowsToFragment'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
`确定要清理选中的 ${selectedRows.value.length} 条数据吗?`,
|
$t('page.ui.fragmentConfirm', { n: selectedRows.value.length }),
|
||||||
'清理碎片操作',
|
$t('page.ui.fragmentTitle'),
|
||||||
{
|
{
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
api.fragment({ tables: selectedRows.value.map((row) => row.name) }).then(() => {
|
api.fragment({ tables: selectedRows.value.map((row) => row.name) }).then(() => {
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success($t('uiMsg.operationSuccess'))
|
||||||
refreshData()
|
refreshData()
|
||||||
selectedRows.value = []
|
selectedRows.value = []
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -129,7 +129,8 @@
|
|||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import TableSearch from './modules/table-search.vue'
|
import TableSearch from './modules/table-search.vue'
|
||||||
import EditDialog from './modules/edit-dialog.vue'
|
import EditDialog from './modules/edit-dialog.vue'
|
||||||
import WorkDialog from './modules/work-dialog.vue'
|
import WorkDialog from './modules/work-dialog.vue'
|
||||||
@@ -252,15 +253,15 @@
|
|||||||
* @param row
|
* @param row
|
||||||
*/
|
*/
|
||||||
const handlePassword = (row: any) => {
|
const handlePassword = (row: any) => {
|
||||||
ElMessageBox.prompt('请输入新密码', '提示', {
|
ElMessageBox.prompt($t('page.ui.promptNewPassword'), $t('uiMsg.titlePrompt'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
inputPattern: /^.{6,16}$/,
|
inputPattern: /^.{6,16}$/,
|
||||||
inputErrorMessage: '密码长度在6到16之间',
|
inputErrorMessage: $t('page.ui.passwordLengthError'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
api.changePassword({ id: row.id, password: value }).then(() => {
|
api.changePassword({ id: row.id, password: value }).then(() => {
|
||||||
ElMessage.success('修改密码成功')
|
ElMessage.success($t('page.ui.passwordChanged'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -270,13 +271,13 @@
|
|||||||
* @param row
|
* @param row
|
||||||
*/
|
*/
|
||||||
const handleCache = (row: any) => {
|
const handleCache = (row: any) => {
|
||||||
ElMessageBox.confirm('确定要清理缓存吗?', '提示', {
|
ElMessageBox.confirm($t('page.ui.clearCacheConfirm'), $t('uiMsg.titlePrompt'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
api.clearCache({ id: row.id }).then(() => {
|
api.clearCache({ id: row.id }).then(() => {
|
||||||
ElMessage.success('清理缓存成功')
|
ElMessage.success($t('uiMsg.clearCacheSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import api from '@/api/safeguard/database'
|
import api from '@/api/safeguard/database'
|
||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
import generate from '@/api/tool/generate'
|
import generate from '@/api/tool/generate'
|
||||||
@@ -172,7 +173,7 @@
|
|||||||
// 确认选择装载数据表
|
// 确认选择装载数据表
|
||||||
const handleLoadTable = async () => {
|
const handleLoadTable = async () => {
|
||||||
if (selectedRows.value.length < 1) {
|
if (selectedRows.value.length < 1) {
|
||||||
ElMessage.info('至少要选择一条数据')
|
ElMessage.info($t('uiMsg.selectAtLeastOne'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const names = selectedRows.value.map((item) => ({
|
const names = selectedRows.value.map((item) => ({
|
||||||
@@ -185,7 +186,7 @@
|
|||||||
source: searchForm.value.source,
|
source: searchForm.value.source,
|
||||||
names
|
names
|
||||||
})
|
})
|
||||||
ElMessage.success('装载成功')
|
ElMessage.success($t('page.ui.loadSuccess'))
|
||||||
emit('success')
|
emit('success')
|
||||||
handleClose()
|
handleClose()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useClipboard } from '@vueuse/core'
|
import { useClipboard } from '@vueuse/core'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import generate from '@/api/tool/generate'
|
import generate from '@/api/tool/generate'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -94,9 +95,9 @@
|
|||||||
const handleCopy = async (code: string) => {
|
const handleCopy = async (code: string) => {
|
||||||
try {
|
try {
|
||||||
await copy(code)
|
await copy(code)
|
||||||
ElMessage.success('代码已复制到剪贴板')
|
ElMessage.success($t('page.ui.copyToClipboard'))
|
||||||
} catch {
|
} catch {
|
||||||
ElMessage.error('复制失败,请手动复制')
|
ElMessage.error($t('uiMsg.copyFail'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -133,6 +133,7 @@
|
|||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import api from '@/api/tool/generate'
|
import api from '@/api/tool/generate'
|
||||||
import { downloadFile } from '@/utils/tool'
|
import { downloadFile } from '@/utils/tool'
|
||||||
|
|
||||||
@@ -211,15 +212,15 @@
|
|||||||
* 生成代码下载
|
* 生成代码下载
|
||||||
*/
|
*/
|
||||||
const generateCode = async (ids: number | string) => {
|
const generateCode = async (ids: number | string) => {
|
||||||
ElMessage.info('代码生成下载中,请稍后')
|
ElMessage.info($t('page.ui.generating'))
|
||||||
const response = await api.generateCode({
|
const response = await api.generateCode({
|
||||||
ids: ids.toString().split(',')
|
ids: ids.toString().split(',')
|
||||||
})
|
})
|
||||||
if (response) {
|
if (response) {
|
||||||
downloadFile(response, 'code.zip')
|
downloadFile(response, 'code.zip')
|
||||||
ElMessage.success('代码生成成功,开始下载')
|
ElMessage.success($t('page.ui.generateSuccess'))
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error('文件下载失败')
|
ElMessage.error($t('page.ui.downloadFail'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,13 +228,13 @@
|
|||||||
* 同步表结构
|
* 同步表结构
|
||||||
*/
|
*/
|
||||||
const syncTable = async (id: number) => {
|
const syncTable = async (id: number) => {
|
||||||
ElMessageBox.confirm('执行同步操作将会覆盖已经设置的表结构,确定要同步吗?', '提示', {
|
ElMessageBox.confirm($t('page.ui.syncConfirm'), $t('uiMsg.titlePrompt'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
api.async({ id }).then(() => {
|
api.async({ id }).then(() => {
|
||||||
ElMessage.success('同步成功')
|
ElMessage.success($t('page.ui.syncSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -242,13 +243,13 @@
|
|||||||
* 生成到项目
|
* 生成到项目
|
||||||
*/
|
*/
|
||||||
const generateFile = async (id: number) => {
|
const generateFile = async (id: number) => {
|
||||||
ElMessageBox.confirm('生成到项目将会覆盖原有文件,确定要生成吗?', '提示', {
|
ElMessageBox.confirm($t('page.ui.generateToProjectConfirm'), $t('uiMsg.titlePrompt'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
api.generateFile({ id }).then(() => {
|
api.generateFile({ id }).then(() => {
|
||||||
ElMessage.success('生成到项目成功')
|
ElMessage.success($t('page.ui.generateToProjectSuccess'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -258,7 +259,7 @@
|
|||||||
*/
|
*/
|
||||||
const batchGenerate = () => {
|
const batchGenerate = () => {
|
||||||
if (selectedRows.value.length === 0) {
|
if (selectedRows.value.length === 0) {
|
||||||
ElMessage.error('至少要选择一条数据')
|
ElMessage.error($t('uiMsg.selectAtLeastOne'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
generateCode(selectedRows.value.map((item: any) => item.id).join(','))
|
generateCode(selectedRows.value.map((item: any) => item.id).join(','))
|
||||||
|
|||||||
@@ -79,6 +79,7 @@
|
|||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
import { useSaiAdmin } from '@/composables/useSaiAdmin'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import api from '@/api/tool/crontab'
|
import api from '@/api/tool/crontab'
|
||||||
import TableSearch from './modules/table-search.vue'
|
import TableSearch from './modules/table-search.vue'
|
||||||
import EditDialog from './modules/edit-dialog.vue'
|
import EditDialog from './modules/edit-dialog.vue'
|
||||||
@@ -146,13 +147,13 @@
|
|||||||
|
|
||||||
// 运行任务
|
// 运行任务
|
||||||
const handleRun = (row: any) => {
|
const handleRun = (row: any) => {
|
||||||
ElMessageBox.confirm(`确定要运行任务【${row.name}】吗?`, '运行任务', {
|
ElMessageBox.confirm($t('page.ui.runConfirm', { name: row.name }), $t('page.ui.runTitle'), {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
api.run({ id: row.id }).then(() => {
|
api.run({ id: row.id }).then(() => {
|
||||||
ElMessage.success('任务运行成功')
|
ElMessage.success($t('page.ui.runSuccess'))
|
||||||
refreshData()
|
refreshData()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -76,6 +76,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { $t } from '@/locales'
|
||||||
import api from '@/api/tool/crontab'
|
import api from '@/api/tool/crontab'
|
||||||
import { useTable } from '@/hooks/core/useTable'
|
import { useTable } from '@/hooks/core/useTable'
|
||||||
|
|
||||||
@@ -128,7 +129,7 @@
|
|||||||
*/
|
*/
|
||||||
const initPage = async () => {
|
const initPage = async () => {
|
||||||
if (!props.data?.id) {
|
if (!props.data?.id) {
|
||||||
ElMessage.error('请先选择一个任务')
|
ElMessage.error($t('page.ui.selectTaskFirst'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
searchForm.value.crontab_id = props.data.id
|
searchForm.value.crontab_id = props.data.id
|
||||||
@@ -166,20 +167,20 @@
|
|||||||
// 确认选择装载数据表
|
// 确认选择装载数据表
|
||||||
const handleLoadTable = async () => {
|
const handleLoadTable = async () => {
|
||||||
if (selectedRows.value.length < 1) {
|
if (selectedRows.value.length < 1) {
|
||||||
ElMessage.info('至少要选择一条数据')
|
ElMessage.info($t('uiMsg.selectAtLeastOne'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
`确定要删除选中的 ${selectedRows.value.length} 条数据吗?`,
|
$t('uiMsg.deleteConfirmSelected', { n: selectedRows.value.length }),
|
||||||
'删除选中数据',
|
$t('uiMsg.titleDeleteSelected'),
|
||||||
{
|
{
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: $t('uiMsg.btnOk'),
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: $t('uiMsg.btnCancel'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
api.deleteCrontabLog({ ids: selectedRows.value.map((row) => row.id) }).then(() => {
|
api.deleteCrontabLog({ ids: selectedRows.value.map((row) => row.id) }).then(() => {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success($t('uiMsg.deleteSuccess'))
|
||||||
refreshData()
|
refreshData()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -74,30 +74,30 @@ class GameController extends BaseController
|
|||||||
* 购买抽奖券
|
* 购买抽奖券
|
||||||
* POST /api/game/buyLotteryTickets
|
* POST /api/game/buyLotteryTickets
|
||||||
* header: token(由 TokenMiddleware 注入 request->player_id)
|
* header: token(由 TokenMiddleware 注入 request->player_id)
|
||||||
* body: count = 1 | 5 | 10(1次/100coin, 5次/500coin, 10次/1000coin)
|
* body: count = 1 | 5 | 10(1次/1coin, 5次/5coin, 10次/10coin)
|
||||||
*/
|
*/
|
||||||
public function buyLotteryTickets(Request $request): Response
|
// public function buyLotteryTickets(Request $request): Response
|
||||||
{
|
// {
|
||||||
$userId = (int) ($request->player_id ?? 0);
|
// $userId = (int) ($request->player_id ?? 0);
|
||||||
$count = (int) $request->post('count', 0);
|
// $count = (int) $request->post('count', 0);
|
||||||
if (!in_array($count, [1, 5, 10], true)) {
|
// if (!in_array($count, [1, 5, 10], true)) {
|
||||||
return $this->fail('Invalid lottery ticket purchase', ReturnCode::PARAMS_ERROR);
|
// return $this->fail('Invalid lottery ticket purchase', ReturnCode::PARAMS_ERROR);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
try {
|
// try {
|
||||||
$logic = new GameLogic();
|
// $logic = new GameLogic();
|
||||||
$data = $logic->buyLotteryTickets($userId, $count);
|
// $data = $logic->buyLotteryTickets($userId, $count);
|
||||||
return $this->success($data);
|
// return $this->success($data);
|
||||||
} catch (ApiException $e) {
|
// } catch (ApiException $e) {
|
||||||
$msg = $e->getMessage();
|
// $msg = $e->getMessage();
|
||||||
if ($msg === '平台币不足') {
|
// if ($msg === '平台币不足') {
|
||||||
$player = DicePlayer::find($userId);
|
// $player = DicePlayer::find($userId);
|
||||||
$coin = $player ? (float) $player->coin : 0;
|
// $coin = $player ? (float) $player->coin : 0;
|
||||||
return $this->success(['coin' => $coin], $msg);
|
// return $this->success(['coin' => $coin], $msg);
|
||||||
}
|
// }
|
||||||
return $this->fail($msg, ReturnCode::BUSINESS_ERROR);
|
// return $this->fail($msg, ReturnCode::BUSINESS_ERROR);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取彩金池(中奖配置表)
|
* 获取彩金池(中奖配置表)
|
||||||
@@ -128,6 +128,8 @@ class GameController extends BaseController
|
|||||||
if ($uiEn !== '') {
|
if ($uiEn !== '') {
|
||||||
$row['ui_text'] = $uiEn;
|
$row['ui_text'] = $uiEn;
|
||||||
}
|
}
|
||||||
|
//移除掉其中的s_start_index和n_start_index
|
||||||
|
$row = array_diff_key($row, ['s_start_index'=>'', 's_end_index'=>'', 'weight'=>'', 'ui_text_en'=>'', 'create_time'=>'', 'update_time'=>'', 'type'=>'']);
|
||||||
$list[$index] = $row;
|
$list[$index] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -194,10 +196,11 @@ class GameController extends BaseController
|
|||||||
$langLower = strtolower($lang);
|
$langLower = strtolower($lang);
|
||||||
$isEn = $langLower === 'en' || str_starts_with($langLower, 'en-');
|
$isEn = $langLower === 'en' || str_starts_with($langLower, 'en-');
|
||||||
|
|
||||||
if (is_array($data) && array_key_exists('reward_config_id', $data)) {
|
if (is_array($data)) {
|
||||||
$rewardConfigId = (int) $data['reward_config_id'];
|
$rewardTier = array_key_exists('reward_tier', $data) ? (string) ($data['reward_tier'] ?? '') : '';
|
||||||
if ($rewardConfigId > 0) {
|
$targetIndex = array_key_exists('target_index', $data) ? (int) ($data['target_index'] ?? 0) : 0;
|
||||||
$configRow = DiceRewardConfig::getCachedById($rewardConfigId);
|
if ($rewardTier !== 'BIGWIN' && $targetIndex > 0) {
|
||||||
|
$configRow = DiceRewardConfig::getCachedById($targetIndex);
|
||||||
if ($configRow !== null) {
|
if ($configRow !== null) {
|
||||||
$uiText = '';
|
$uiText = '';
|
||||||
$uiTextEn = '';
|
$uiTextEn = '';
|
||||||
@@ -216,6 +219,7 @@ class GameController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$data['tier'] = $data['reward_tier'] ?? '';
|
||||||
|
|
||||||
return $this->success($data);
|
return $this->success($data);
|
||||||
} catch (ApiException $e) {
|
} catch (ApiException $e) {
|
||||||
@@ -247,9 +251,8 @@ class GameController extends BaseController
|
|||||||
'win_coin' => 0,
|
'win_coin' => 0,
|
||||||
'super_win_coin' => 0,
|
'super_win_coin' => 0,
|
||||||
'reward_win_coin' => 0,
|
'reward_win_coin' => 0,
|
||||||
'use_coins' => 0,
|
|
||||||
'direction' => $direction,
|
'direction' => $direction,
|
||||||
'reward_config_id' => 0,
|
'reward_tier' => '',
|
||||||
'start_index' => 0,
|
'start_index' => 0,
|
||||||
'target_index' => 0,
|
'target_index' => 0,
|
||||||
'roll_array' => '[]',
|
'roll_array' => '[]',
|
||||||
|
|||||||
@@ -26,9 +26,13 @@ class UserController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function Login(Request $request): Response
|
public function Login(Request $request): Response
|
||||||
{
|
{
|
||||||
$username = trim((string) ($request->post('username', '')));
|
$usernameRaw = $request->post('username', '');
|
||||||
$password = trim((string) ($request->post('password', '')));
|
$passwordRaw = $request->post('password', '');
|
||||||
$lang = trim((string) ($request->post('lang', 'chs')));
|
$langRaw = $request->post('lang', 'zh');
|
||||||
|
|
||||||
|
$username = is_string($usernameRaw) ? trim($usernameRaw) : '';
|
||||||
|
$password = is_string($passwordRaw) ? trim($passwordRaw) : '';
|
||||||
|
$lang = is_string($langRaw) ? trim($langRaw) : 'zh';
|
||||||
$coin = $request->post('coin');
|
$coin = $request->post('coin');
|
||||||
$coin = $coin !== null && $coin !== '' ? (float) $coin : 0.0;
|
$coin = $coin !== null && $coin !== '' ? (float) $coin : 0.0;
|
||||||
$time = $request->post('time');
|
$time = $request->post('time');
|
||||||
@@ -91,7 +95,7 @@ class UserController extends BaseController
|
|||||||
if (empty($user)) {
|
if (empty($user)) {
|
||||||
return $this->fail('User not found', ReturnCode::NOT_FOUND);
|
return $this->fail('User not found', ReturnCode::NOT_FOUND);
|
||||||
}
|
}
|
||||||
$fields = ['id', 'username', 'phone', 'uid', 'name', 'coin', 'total_ticket_count'];
|
$fields = ['id', 'username', 'phone', 'uid', 'name', 'coin', 'total_ticket_count', 'free_ticket'];
|
||||||
$info = [];
|
$info = [];
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
if (array_key_exists($field, $user)) {
|
if (array_key_exists($field, $user)) {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class GameController extends BaseController
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$logic = new UserLogic();
|
$logic = new UserLogic();
|
||||||
$result = $logic->loginByUsername($username, $password, $lang === 'en' ? 'en' : 'chs', 0.0, $time, $adminId, $adminIdsInTopDept);
|
$result = $logic->loginByUsername($username, $password, $lang, 0.0, $time, $adminId, $adminIdsInTopDept);
|
||||||
} catch (\plugin\saiadmin\exception\ApiException $e) {
|
} catch (\plugin\saiadmin\exception\ApiException $e) {
|
||||||
return $this->fail($e->getMessage(), ReturnCode::PARAMS_ERROR);
|
return $this->fail($e->getMessage(), ReturnCode::PARAMS_ERROR);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ return [
|
|||||||
'账号已被禁用,无法登录' => 'Account is disabled and cannot log in',
|
'账号已被禁用,无法登录' => 'Account is disabled and cannot log in',
|
||||||
'购买抽奖券错误' => 'Invalid lottery ticket purchase',
|
'购买抽奖券错误' => 'Invalid lottery ticket purchase',
|
||||||
'平台币不足' => 'Insufficient balance',
|
'平台币不足' => 'Insufficient balance',
|
||||||
|
'余额不足' => 'Insufficient balance',
|
||||||
'direction 必须为 0 或 1' => 'direction must be 0 or 1',
|
'direction 必须为 0 或 1' => 'direction must be 0 or 1',
|
||||||
'当前玩家余额%s小于%s无法继续游戏' => 'Balance %s is less than %s, cannot continue',
|
'当前玩家余额%s小于%s无法继续游戏' => 'Balance %s is less than %s, cannot continue',
|
||||||
'服务超时,' => 'Service timeout: ',
|
'服务超时,' => 'Service timeout: ',
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ use support\think\Db;
|
|||||||
class GameLogic
|
class GameLogic
|
||||||
{
|
{
|
||||||
public const PACKAGES = [
|
public const PACKAGES = [
|
||||||
1 => ['coin' => 100, 'paid' => 1, 'free' => 0], // 1次/100coin
|
1 => ['coin' => 1, 'paid' => 1, 'free' => 0], // 1次/1coin
|
||||||
5 => ['coin' => 500, 'paid' => 5, 'free' => 1], // 5张/500coin(5购买+1赠送,共6次)
|
5 => ['coin' => 5, 'paid' => 5, 'free' => 1], // 5张/5coin(5购买+1赠送,共6次)
|
||||||
10 => ['coin' => 1000, 'paid' => 10, 'free' => 3], // 10张/1000coin(10购买+3赠送,共13次)
|
10 => ['coin' => 10, 'paid' => 10, 'free' => 3], // 10张/10coin(10购买+3赠送,共13次)
|
||||||
];
|
];
|
||||||
|
|
||||||
/** 钱包流水类型:购买抽奖次数 */
|
/** 钱包流水类型:购买抽奖次数 */
|
||||||
@@ -52,7 +52,7 @@ class GameLogic
|
|||||||
throw new ApiException('Insufficient balance');
|
throw new ApiException('Insufficient balance');
|
||||||
}
|
}
|
||||||
|
|
||||||
$coinAfter = $coinBefore - $cost;
|
$coinAfter = round($coinBefore - $cost, 2);
|
||||||
$totalBefore = (int) ($player->total_ticket_count ?? 0);
|
$totalBefore = (int) ($player->total_ticket_count ?? 0);
|
||||||
$paidBefore = (int) ($player->paid_ticket_count ?? 0);
|
$paidBefore = (int) ($player->paid_ticket_count ?? 0);
|
||||||
$freeBefore = (int) ($player->free_ticket_count ?? 0);
|
$freeBefore = (int) ($player->free_ticket_count ?? 0);
|
||||||
@@ -94,7 +94,7 @@ class GameLogic
|
|||||||
DicePlayerWalletRecord::create([
|
DicePlayerWalletRecord::create([
|
||||||
'player_id' => $playerId,
|
'player_id' => $playerId,
|
||||||
'admin_id' => $adminId,
|
'admin_id' => $adminId,
|
||||||
'coin' => -$cost,
|
'coin' => round(-$cost, 2),
|
||||||
'type' => self::WALLET_TYPE_BUY_DRAW,
|
'type' => self::WALLET_TYPE_BUY_DRAW,
|
||||||
'wallet_before' => $coinBefore,
|
'wallet_before' => $coinBefore,
|
||||||
'wallet_after' => $coinAfter,
|
'wallet_after' => $coinAfter,
|
||||||
@@ -107,7 +107,7 @@ class GameLogic
|
|||||||
DicePlayerTicketRecord::create([
|
DicePlayerTicketRecord::create([
|
||||||
'player_id' => $playerId,
|
'player_id' => $playerId,
|
||||||
'admin_id' => $adminId,
|
'admin_id' => $adminId,
|
||||||
'use_coins' => $cost,
|
'use_coins' => round($cost, 2),
|
||||||
'ante' => 1,
|
'ante' => 1,
|
||||||
'total_ticket_count' => $addTotal,
|
'total_ticket_count' => $addTotal,
|
||||||
'paid_ticket_count' => $addPaid,
|
'paid_ticket_count' => $addPaid,
|
||||||
@@ -121,7 +121,7 @@ class GameLogic
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'coin' => (float) $coinAfter,
|
'coin' => round((float) $coinAfter, 2),
|
||||||
'total_ticket_count' => (int) $totalAfter,
|
'total_ticket_count' => (int) $totalAfter,
|
||||||
'paid_ticket_count' => (int) $paidAfter,
|
'paid_ticket_count' => (int) $paidAfter,
|
||||||
'free_ticket_count' => (int) $freeAfter,
|
'free_ticket_count' => (int) $freeAfter,
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ use support\think\Db;
|
|||||||
*/
|
*/
|
||||||
class PlayStartLogic
|
class PlayStartLogic
|
||||||
{
|
{
|
||||||
|
/** 钱包流水类型:购买抽奖次数 */
|
||||||
|
public const WALLET_TYPE_BUY_DRAW = 2;
|
||||||
/** 抽奖类型:付费 */
|
/** 抽奖类型:付费 */
|
||||||
public const LOTTERY_TYPE_PAID = 0;
|
public const LOTTERY_TYPE_PAID = 0;
|
||||||
/** 抽奖类型:免费 */
|
/** 抽奖类型:免费 */
|
||||||
@@ -35,8 +37,8 @@ class PlayStartLogic
|
|||||||
/** 对局状态:超时/失败 */
|
/** 对局状态:超时/失败 */
|
||||||
public const RECORD_STATUS_TIMEOUT = 0;
|
public const RECORD_STATUS_TIMEOUT = 0;
|
||||||
|
|
||||||
/** 单注费用(对应原票价 100) */
|
/** 单注费用(抽奖券基础费用) */
|
||||||
private const UNIT_COST = 100;
|
private const UNIT_COST = 1.0;
|
||||||
/** 免费抽奖注数缓存 key 前缀(用于强制下一局注数一致) */
|
/** 免费抽奖注数缓存 key 前缀(用于强制下一局注数一致) */
|
||||||
private const FREE_ANTE_KEY_PREFIX = 'api:game:free_ante:';
|
private const FREE_ANTE_KEY_PREFIX = 'api:game:free_ante:';
|
||||||
/** 免费抽奖注数缓存过期(秒) */
|
/** 免费抽奖注数缓存过期(秒) */
|
||||||
@@ -74,12 +76,32 @@ class PlayStartLogic
|
|||||||
throw new ApiException('当前注数不合规,请选择正确的注数');
|
throw new ApiException('当前注数不合规,请选择正确的注数');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 免费抽奖:不再使用抽奖券作为开始条件,仅用 free_ticket_count 表示“免费抽奖次数”
|
// 免费抽奖:优先使用 free_ticket(带 ante 与 count);兼容旧字段 free_ticket_count
|
||||||
$freeCount = (int) ($player->free_ticket_count ?? 0);
|
$freeTicket = $player->free_ticket ?? null;
|
||||||
$isFree = $freeCount > 0;
|
$freeTicketAnte = null;
|
||||||
|
$freeTicketCount = 0;
|
||||||
|
if (is_array($freeTicket)) {
|
||||||
|
$a = $freeTicket['ante'] ?? null;
|
||||||
|
$c = $freeTicket['count'] ?? null;
|
||||||
|
if ($a !== null && $a !== '' && is_numeric($a)) {
|
||||||
|
$freeTicketAnte = (int) $a;
|
||||||
|
}
|
||||||
|
if ($c !== null && $c !== '' && is_numeric($c)) {
|
||||||
|
$freeTicketCount = (int) $c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$legacyFreeCount = (int) ($player->free_ticket_count ?? 0);
|
||||||
|
$isFree = ($freeTicketAnte !== null && $freeTicketCount > 0) || $legacyFreeCount > 0;
|
||||||
$ticketType = $isFree ? self::LOTTERY_TYPE_FREE : self::LOTTERY_TYPE_PAID;
|
$ticketType = $isFree ? self::LOTTERY_TYPE_FREE : self::LOTTERY_TYPE_PAID;
|
||||||
|
|
||||||
// 若为免费抽奖:注数必须与上一次触发免费抽奖时的注数一致
|
// 若为 free_ticket 免费抽奖:注数必须与券的 ante 一致
|
||||||
|
if ($ticketType === self::LOTTERY_TYPE_FREE && $freeTicketAnte !== null && $freeTicketCount > 0) {
|
||||||
|
if ($ante !== $freeTicketAnte) {
|
||||||
|
throw new ApiException('您有一张底注为' . $freeTicketAnte . '的免费抽奖券');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 若为免费抽奖(旧逻辑):注数必须与上一次触发免费抽奖时的注数一致
|
||||||
if ($isFree) {
|
if ($isFree) {
|
||||||
$requiredAnte = Cache::get(self::FREE_ANTE_KEY_PREFIX . $playerId);
|
$requiredAnte = Cache::get(self::FREE_ANTE_KEY_PREFIX . $playerId);
|
||||||
if ($requiredAnte !== null && $requiredAnte !== '' && (int) $requiredAnte !== $ante) {
|
if ($requiredAnte !== null && $requiredAnte !== '' && (int) $requiredAnte !== $ante) {
|
||||||
@@ -93,16 +115,29 @@ class PlayStartLogic
|
|||||||
throw new ApiException('Lottery pool config not found (name=default required)');
|
throw new ApiException('Lottery pool config not found (name=default required)');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 余额校验:统一校验 ante * min(real_ev)
|
// 付费抽奖:开始前扣除费用 ante * UNIT_COST
|
||||||
$minEv = DiceRewardConfig::getCachedMinRealEv();
|
$paidAmount = $ticketType === self::LOTTERY_TYPE_PAID ? round($ante * self::UNIT_COST, 2) : 0.0;
|
||||||
$needMinBalance = abs((float) $minEv) * $ante;
|
|
||||||
if ($coin < $needMinBalance) {
|
|
||||||
throw new ApiException('未达抽奖余额 ' . $needMinBalance . ',无法开始游戏');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 付费抽奖:开始前扣除费用 ante * 100,不足则提示余额不足
|
// 游玩前余额校验(按 T4 惩罚最大值兜底):
|
||||||
$paidAmount = $ticketType === self::LOTTERY_TYPE_PAID ? ($ante * self::UNIT_COST) : 0;
|
// 门槛 = paidAmount(压注*1) + abs(T4最小real_ev)*ante
|
||||||
if ($ticketType === self::LOTTERY_TYPE_PAID && $coin < $paidAmount) {
|
$t4List = DiceRewardConfig::getCachedByTier('T4');
|
||||||
|
$t4MinRealEv = null;
|
||||||
|
foreach ($t4List as $row) {
|
||||||
|
$ev = $row['real_ev'] ?? null;
|
||||||
|
if ($ev === null || $ev === '') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$evFloat = filter_var($ev, FILTER_VALIDATE_FLOAT);
|
||||||
|
if ($evFloat === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($t4MinRealEv === null || $evFloat < $t4MinRealEv) {
|
||||||
|
$t4MinRealEv = $evFloat;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$t4PenaltyAbs = $t4MinRealEv === null ? 0.0 : abs($t4MinRealEv) * $ante;
|
||||||
|
$needMinBalance = round($paidAmount + $t4PenaltyAbs, 2);
|
||||||
|
if ($coin < $needMinBalance) {
|
||||||
throw new ApiException('余额不足');
|
throw new ApiException('余额不足');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,13 +196,17 @@ class PlayStartLogic
|
|||||||
$targetIndex = (int) ($chosen['end_index'] ?? 0);
|
$targetIndex = (int) ($chosen['end_index'] ?? 0);
|
||||||
$rollNumber = (int) ($chosen['grid_number'] ?? 0);
|
$rollNumber = (int) ($chosen['grid_number'] ?? 0);
|
||||||
$realEv = (float) ($chosen['real_ev'] ?? 0);
|
$realEv = (float) ($chosen['real_ev'] ?? 0);
|
||||||
|
// T5/再来一次:以奖励行 tier 为准,并以摇奖档位 $tier 兜底(与 reward_tier 展示一致,避免 dice_reward 行缺 tier 时不发券)
|
||||||
$isTierT5 = (string) ($chosen['tier'] ?? '') === 'T5';
|
$isTierT5 = (string) ($chosen['tier'] ?? '') === 'T5';
|
||||||
// 摇色子中奖:按 dice_reward_config.real_ev 直接结算(已乘 ante);不再叠加票价 100
|
if ($isTierT5 === false && (string) ($tier ?? '') === 'T5') {
|
||||||
$rewardWinCoin = $realEv * $ante;
|
$isTierT5 = true;
|
||||||
|
}
|
||||||
|
// 摇色子中奖:按 dice_reward_config.real_ev 直接结算(已乘 ante)
|
||||||
|
$rewardWinCoin = round($realEv * $ante, 2);
|
||||||
|
|
||||||
// 豹子判定:5/30 必豹子;10/15/20/25 按 DiceRewardConfig 中 BIGWIN 该点数的 weight 判定(0-10000,10000=100%)
|
// 豹子判定:5/30 必豹子;10/15/20/25 按 DiceRewardConfig 中 BIGWIN 该点数的 weight 判定(0-10000,10000=100%)
|
||||||
// 杀分档位:不触发豹子,5/30 已在上方抽取时排除,10/15/20/25 仅生成非豹子组合
|
// 杀分档位:不触发豹子,5/30 已在上方抽取时排除,10/15/20/25 仅生成非豹子组合
|
||||||
$superWinCoin = 0;
|
$superWinCoin = 0.0;
|
||||||
$isWin = 0;
|
$isWin = 0;
|
||||||
$bigWinRealEv = 0.0;
|
$bigWinRealEv = 0.0;
|
||||||
if (in_array($rollNumber, self::SUPER_WIN_GRID_NUMBERS, true)) {
|
if (in_array($rollNumber, self::SUPER_WIN_GRID_NUMBERS, true)) {
|
||||||
@@ -197,10 +236,10 @@ class PlayStartLogic
|
|||||||
$rollArray = $this->getSuperWinRollArray($rollNumber);
|
$rollArray = $this->getSuperWinRollArray($rollNumber);
|
||||||
$isWin = 1;
|
$isWin = 1;
|
||||||
$bigWinEv = $bigWinRealEv > 0 ? $bigWinRealEv : self::SUPER_WIN_BONUS;
|
$bigWinEv = $bigWinRealEv > 0 ? $bigWinRealEv : self::SUPER_WIN_BONUS;
|
||||||
$superWinCoin = $bigWinEv * $ante;
|
$superWinCoin = round($bigWinEv * $ante, 2);
|
||||||
// 中 BIGWIN 豹子:不走原奖励流程,不记录原奖励,不触发 T5 再来一次,仅发放豹子奖金
|
// 中 BIGWIN 豹子:不走原奖励流程,不记录原奖励,不触发 T5 再来一次,仅发放豹子奖金
|
||||||
$rewardWinCoin = 0;
|
$rewardWinCoin = 0.0;
|
||||||
$realEv = 0;
|
$realEv = 0.0;
|
||||||
$isTierT5 = false;
|
$isTierT5 = false;
|
||||||
} else {
|
} else {
|
||||||
$rollArray = $this->generateNonSuperWinRollArrayWithSum($rollNumber);
|
$rollArray = $this->generateNonSuperWinRollArrayWithSum($rollNumber);
|
||||||
@@ -217,7 +256,7 @@ class PlayStartLogic
|
|||||||
$startIndex,
|
$startIndex,
|
||||||
$targetIndex
|
$targetIndex
|
||||||
));
|
));
|
||||||
$winCoin = $superWinCoin + $rewardWinCoin; // 赢取平台币 = 中大奖 + 摇色子中奖(豹子时 rewardWinCoin 已为 0)
|
$winCoin = round($superWinCoin + $rewardWinCoin, 2); // 赢取平台币 = 中大奖 + 摇色子中奖(豹子时 rewardWinCoin 已为 0)
|
||||||
|
|
||||||
$record = null;
|
$record = null;
|
||||||
$configId = (int) $config->id;
|
$configId = (int) $config->id;
|
||||||
@@ -231,7 +270,6 @@ class PlayStartLogic
|
|||||||
$adminId,
|
$adminId,
|
||||||
$configId,
|
$configId,
|
||||||
$type0ConfigId,
|
$type0ConfigId,
|
||||||
$rewardId,
|
|
||||||
$configName,
|
$configName,
|
||||||
$ticketType,
|
$ticketType,
|
||||||
$ante,
|
$ante,
|
||||||
@@ -247,8 +285,10 @@ class PlayStartLogic
|
|||||||
$targetIndex,
|
$targetIndex,
|
||||||
$rollArray,
|
$rollArray,
|
||||||
$isTierT5,
|
$isTierT5,
|
||||||
|
$tier,
|
||||||
&$record
|
&$record
|
||||||
) {
|
) {
|
||||||
|
$rewardTier = ($isWin === 1 && $superWinCoin > 0) ? 'BIGWIN' : (string) ($tier ?? '');
|
||||||
$record = DicePlayRecord::create([
|
$record = DicePlayRecord::create([
|
||||||
'player_id' => $playerId,
|
'player_id' => $playerId,
|
||||||
'admin_id' => $adminId,
|
'admin_id' => $adminId,
|
||||||
@@ -260,14 +300,12 @@ class PlayStartLogic
|
|||||||
'win_coin' => $winCoin,
|
'win_coin' => $winCoin,
|
||||||
'super_win_coin' => $superWinCoin,
|
'super_win_coin' => $superWinCoin,
|
||||||
'reward_win_coin' => $rewardWinCoin,
|
'reward_win_coin' => $rewardWinCoin,
|
||||||
'use_coins' => $paidAmount,
|
|
||||||
'direction' => $direction,
|
'direction' => $direction,
|
||||||
'reward_config_id' => $rewardId,
|
'reward_tier' => $rewardTier,
|
||||||
'start_index' => $startIndex,
|
'start_index' => $startIndex,
|
||||||
'target_index' => $targetIndex,
|
'target_index' => $targetIndex,
|
||||||
'roll_array' => is_array($rollArray) ? json_encode($rollArray) : $rollArray,
|
'roll_array' => is_array($rollArray) ? json_encode($rollArray) : $rollArray,
|
||||||
'roll_number' => is_array($rollArray) ? array_sum($rollArray) : 0,
|
'roll_number' => is_array($rollArray) ? array_sum($rollArray) : 0,
|
||||||
'lottery_name' => $configName,
|
|
||||||
'status' => self::RECORD_STATUS_SUCCESS,
|
'status' => self::RECORD_STATUS_SUCCESS,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -277,12 +315,38 @@ class PlayStartLogic
|
|||||||
}
|
}
|
||||||
$coinBefore = (float) $p->coin;
|
$coinBefore = (float) $p->coin;
|
||||||
// 开始前先扣付费金额,再加中奖金额(免费抽奖 paid_amount=0)
|
// 开始前先扣付费金额,再加中奖金额(免费抽奖 paid_amount=0)
|
||||||
$coinAfter = $coinBefore - $paidAmount + $winCoin;
|
$coinAfter = round($coinBefore - $paidAmount + $winCoin, 2);
|
||||||
|
// T4 惩罚兜底:扣完购券费用后若余额不足以承受本次惩罚(导致为负),统一按“余额不足”提示
|
||||||
|
if ($rewardTier === 'T4' && $coinAfter < 0) {
|
||||||
|
throw new ApiException('余额不足');
|
||||||
|
}
|
||||||
$p->coin = $coinAfter;
|
$p->coin = $coinAfter;
|
||||||
// 不再使用抽奖券作为抽奖条件:付费不扣抽奖次数;免费抽奖仅消耗 free_ticket_count
|
// 免费抽奖消耗:优先消耗 free_ticket.count,耗尽则清空 free_ticket;否则兼容旧 free_ticket_count
|
||||||
if ($ticketType === self::LOTTERY_TYPE_FREE) {
|
if ($ticketType === self::LOTTERY_TYPE_FREE) {
|
||||||
|
$ft = $p->free_ticket ?? null;
|
||||||
|
$ftAnte = null;
|
||||||
|
$ftCount = 0;
|
||||||
|
if (is_array($ft)) {
|
||||||
|
$a = $ft['ante'] ?? null;
|
||||||
|
$c = $ft['count'] ?? null;
|
||||||
|
if ($a !== null && $a !== '' && is_numeric($a)) {
|
||||||
|
$ftAnte = (int) $a;
|
||||||
|
}
|
||||||
|
if ($c !== null && $c !== '' && is_numeric($c)) {
|
||||||
|
$ftCount = (int) $c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($ftAnte !== null && $ftCount > 0) {
|
||||||
|
$next = $ftCount - 1;
|
||||||
|
if ($next <= 0) {
|
||||||
|
$p->free_ticket = null;
|
||||||
|
} else {
|
||||||
|
$p->free_ticket = ['ante' => $ftAnte, 'count' => $next];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
$p->free_ticket_count = max(0, (int) $p->free_ticket_count - 1);
|
$p->free_ticket_count = max(0, (int) $p->free_ticket_count - 1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 记录每次游玩:写入抽奖券记录(用于后台“抽奖券记录”追踪付费/免费游玩与消耗)
|
// 记录每次游玩:写入抽奖券记录(用于后台“抽奖券记录”追踪付费/免费游玩与消耗)
|
||||||
$isPaidPlay = $ticketType === self::LOTTERY_TYPE_PAID;
|
$isPaidPlay = $ticketType === self::LOTTERY_TYPE_PAID;
|
||||||
@@ -299,9 +363,32 @@ class PlayStartLogic
|
|||||||
'remark' => ($isPaidPlay ? '付费游玩' : '免费游玩') . '|play_record_id=' . $record->id,
|
'remark' => ($isPaidPlay ? '付费游玩' : '免费游玩') . '|play_record_id=' . $record->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 若本局中奖档位为 T5,则额外赠送 1 次免费抽奖次数(总次数也 +1),并记录抽奖券获取记录
|
// 若本局中奖档位为 T5,则额外赠送 1 次免费抽奖次数:
|
||||||
|
// - 新结构:写入 free_ticket(ante=本局注数,count+1)
|
||||||
|
// - 兼容旧结构:free_ticket_count +1
|
||||||
if ($isTierT5) {
|
if ($isTierT5) {
|
||||||
|
$ft = $p->free_ticket ?? null;
|
||||||
|
$ftAnte = null;
|
||||||
|
$ftCount = 0;
|
||||||
|
if (is_array($ft)) {
|
||||||
|
$a = $ft['ante'] ?? null;
|
||||||
|
$c = $ft['count'] ?? null;
|
||||||
|
if ($a !== null && $a !== '' && is_numeric($a)) {
|
||||||
|
$ftAnte = (int) $a;
|
||||||
|
}
|
||||||
|
if ($c !== null && $c !== '' && is_numeric($c)) {
|
||||||
|
$ftCount = (int) $c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($ftAnte === null) {
|
||||||
|
$ftAnte = $ante;
|
||||||
|
}
|
||||||
|
if ($ftAnte === $ante) {
|
||||||
|
$p->free_ticket = ['ante' => $ante, 'count' => $ftCount + 1];
|
||||||
|
} else {
|
||||||
|
// 若已有不同注数的免费券,则仍保留旧字段累加,避免覆盖玩家已有券
|
||||||
$p->free_ticket_count = (int) $p->free_ticket_count + 1;
|
$p->free_ticket_count = (int) $p->free_ticket_count + 1;
|
||||||
|
}
|
||||||
|
|
||||||
DicePlayerTicketRecord::create([
|
DicePlayerTicketRecord::create([
|
||||||
'player_id' => $playerId,
|
'player_id' => $playerId,
|
||||||
@@ -314,7 +401,15 @@ class PlayStartLogic
|
|||||||
Cache::set(self::FREE_ANTE_KEY_PREFIX . $playerId, $ante, self::FREE_ANTE_TTL);
|
Cache::set(self::FREE_ANTE_KEY_PREFIX . $playerId, $ante, self::FREE_ANTE_TTL);
|
||||||
} else {
|
} else {
|
||||||
// 若本次消耗了最后一次免费抽奖,则清理注数锁
|
// 若本次消耗了最后一次免费抽奖,则清理注数锁
|
||||||
if ($ticketType === self::LOTTERY_TYPE_FREE && (int) $p->free_ticket_count <= 0) {
|
$ft = $p->free_ticket ?? null;
|
||||||
|
$ftCount = 0;
|
||||||
|
if (is_array($ft)) {
|
||||||
|
$c = $ft['count'] ?? null;
|
||||||
|
if ($c !== null && $c !== '' && is_numeric($c)) {
|
||||||
|
$ftCount = (int) $c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($ticketType === self::LOTTERY_TYPE_FREE && $ftCount <= 0 && (int) $p->free_ticket_count <= 0) {
|
||||||
Cache::delete(self::FREE_ANTE_KEY_PREFIX . $playerId);
|
Cache::delete(self::FREE_ANTE_KEY_PREFIX . $playerId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -322,13 +417,13 @@ class PlayStartLogic
|
|||||||
$p->save();
|
$p->save();
|
||||||
|
|
||||||
// 彩金池累计盈利累加在 name=default 彩金池上:
|
// 彩金池累计盈利累加在 name=default 彩金池上:
|
||||||
// 付费:每局按「本局赢取平台币 win_coin - 抽奖费用 paid_amount(ante*100)」
|
// 付费:每局按「本局赢取平台币 win_coin - 抽奖费用 paid_amount(ante*UNIT_COST)」
|
||||||
// 免费券:paid_amount=0,只计入 win_coin
|
// 免费券:paid_amount=0,只计入 win_coin
|
||||||
$perPlayProfit = ($ticketType === self::LOTTERY_TYPE_PAID) ? ($winCoin - (float) $paidAmount) : $winCoin;
|
$perPlayProfit = ($ticketType === self::LOTTERY_TYPE_PAID) ? ($winCoin - $paidAmount) : $winCoin;
|
||||||
$addProfit = $perPlayProfit;
|
$addProfit = round($perPlayProfit, 2);
|
||||||
try {
|
try {
|
||||||
DiceLotteryPoolConfig::where('id', $type0ConfigId)->update([
|
DiceLotteryPoolConfig::where('id', $type0ConfigId)->update([
|
||||||
'profit_amount' => Db::raw('IFNULL(profit_amount,0) + ' . (float) $addProfit),
|
'profit_amount' => Db::raw('IFNULL(profit_amount,0) + ' . sprintf('%.2f', $addProfit)),
|
||||||
]);
|
]);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
Log::warning('彩金池盈利累加失败', [
|
Log::warning('彩金池盈利累加失败', [
|
||||||
@@ -338,15 +433,30 @@ class PlayStartLogic
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 钱包流水拆分:先记录购券扣费,再记录抽奖结果(中奖/惩罚)
|
||||||
|
if ($paidAmount > 0) {
|
||||||
|
$walletAfterBuy = round($coinBefore - $paidAmount, 2);
|
||||||
DicePlayerWalletRecord::create([
|
DicePlayerWalletRecord::create([
|
||||||
'player_id' => $playerId,
|
'player_id' => $playerId,
|
||||||
'admin_id' => $adminId,
|
'admin_id' => $adminId,
|
||||||
// 钱包流水记录本局净变化:-付费金额 + 中奖金额(免费抽奖付费金额为 0)
|
'coin' => round(-$paidAmount, 2),
|
||||||
'coin' => $winCoin - (float) $paidAmount,
|
'type' => self::WALLET_TYPE_BUY_DRAW,
|
||||||
'type' => self::WALLET_TYPE_DRAW,
|
|
||||||
'wallet_before' => $coinBefore,
|
'wallet_before' => $coinBefore,
|
||||||
|
'wallet_after' => $walletAfterBuy,
|
||||||
|
'remark' => '抽奖购券扣费|play_record_id=' . $record->id,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$walletBeforeDraw = $coinBefore - $paidAmount;
|
||||||
|
$drawRemark = ($winCoin >= 0 ? '抽奖中奖' : '抽奖惩罚') . '|play_record_id=' . $record->id;
|
||||||
|
DicePlayerWalletRecord::create([
|
||||||
|
'player_id' => $playerId,
|
||||||
|
'admin_id' => $adminId,
|
||||||
|
'coin' => $winCoin,
|
||||||
|
'type' => self::WALLET_TYPE_DRAW,
|
||||||
|
'wallet_before' => round($walletBeforeDraw, 2),
|
||||||
'wallet_after' => $coinAfter,
|
'wallet_after' => $coinAfter,
|
||||||
'remark' => '抽奖|play_record_id=' . $record->id,
|
'remark' => $drawRemark,
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
@@ -361,9 +471,8 @@ class PlayStartLogic
|
|||||||
'win_coin' => 0,
|
'win_coin' => 0,
|
||||||
'super_win_coin' => 0,
|
'super_win_coin' => 0,
|
||||||
'reward_win_coin' => 0,
|
'reward_win_coin' => 0,
|
||||||
'use_coins' => 0,
|
|
||||||
'direction' => $direction,
|
'direction' => $direction,
|
||||||
'reward_config_id' => 0,
|
'reward_tier' => '',
|
||||||
'start_index' => $startIndex,
|
'start_index' => $startIndex,
|
||||||
'target_index' => 0,
|
'target_index' => 0,
|
||||||
'roll_array' => '[]',
|
'roll_array' => '[]',
|
||||||
@@ -390,9 +499,11 @@ class PlayStartLogic
|
|||||||
$arr['roll_array'] = json_decode($arr['roll_array'], true) ?? [];
|
$arr['roll_array'] = json_decode($arr['roll_array'], true) ?? [];
|
||||||
}
|
}
|
||||||
$arr['roll_number'] = is_array($arr['roll_array'] ?? null) ? array_sum($arr['roll_array']) : 0;
|
$arr['roll_number'] = is_array($arr['roll_array'] ?? null) ? array_sum($arr['roll_array']) : 0;
|
||||||
$arr['tier'] = $tier ?? '';
|
$arr['reward_tier'] = ($isWin === 1 && $superWinCoin > 0) ? 'BIGWIN' : (string) ($tier ?? '');
|
||||||
// 记录完数据后返回当前玩家余额与抽奖次数
|
// 记录完数据后返回当前玩家余额与抽奖次数
|
||||||
$arr['coin'] = $updated ? (float) $updated->coin : 0;
|
$arr['coin'] = $updated ? round((float) $updated->coin, 2) : 0.0;
|
||||||
|
// 本局从玩家货币中扣除的金额:付费抽奖为 ante*UNIT_COST,免费抽奖为 0(与 paid_amount 一致)
|
||||||
|
$arr['use_coin'] = round($paidAmount, 2);
|
||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -575,9 +686,9 @@ class PlayStartLogic
|
|||||||
$rollNumber = (int) ($chosen['grid_number'] ?? 0);
|
$rollNumber = (int) ($chosen['grid_number'] ?? 0);
|
||||||
$realEv = (float) ($chosen['real_ev'] ?? 0);
|
$realEv = (float) ($chosen['real_ev'] ?? 0);
|
||||||
// 摇色子中奖:按 real_ev 直接结算(与正式抽奖 run() 一致)
|
// 摇色子中奖:按 real_ev 直接结算(与正式抽奖 run() 一致)
|
||||||
$rewardWinCoin = $realEv * $ante;
|
$rewardWinCoin = round($realEv * $ante, 2);
|
||||||
|
|
||||||
$superWinCoin = 0;
|
$superWinCoin = 0.0;
|
||||||
$isWin = 0;
|
$isWin = 0;
|
||||||
$bigWinRealEv = 0.0;
|
$bigWinRealEv = 0.0;
|
||||||
if (in_array($rollNumber, self::SUPER_WIN_GRID_NUMBERS, true)) {
|
if (in_array($rollNumber, self::SUPER_WIN_GRID_NUMBERS, true)) {
|
||||||
@@ -605,8 +716,8 @@ class PlayStartLogic
|
|||||||
$rollArray = $this->getSuperWinRollArray($rollNumber);
|
$rollArray = $this->getSuperWinRollArray($rollNumber);
|
||||||
$isWin = 1;
|
$isWin = 1;
|
||||||
$bigWinEv = $bigWinRealEv > 0 ? $bigWinRealEv : self::SUPER_WIN_BONUS;
|
$bigWinEv = $bigWinRealEv > 0 ? $bigWinRealEv : self::SUPER_WIN_BONUS;
|
||||||
$superWinCoin = $bigWinEv * $ante;
|
$superWinCoin = round($bigWinEv * $ante, 2);
|
||||||
$rewardWinCoin = 0;
|
$rewardWinCoin = 0.0;
|
||||||
// 中豹子时不走原奖励流程
|
// 中豹子时不走原奖励流程
|
||||||
$realEv = 0.0;
|
$realEv = 0.0;
|
||||||
} else {
|
} else {
|
||||||
@@ -617,12 +728,14 @@ class PlayStartLogic
|
|||||||
$rollArray = $this->generateRollArrayFromSum($rollNumber);
|
$rollArray = $this->generateRollArrayFromSum($rollNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
$winCoin = $superWinCoin + $rewardWinCoin;
|
$winCoin = round($superWinCoin + $rewardWinCoin, 2);
|
||||||
$configId = $config !== null ? (int) $config->id : 0;
|
$configId = $config !== null ? (int) $config->id : 0;
|
||||||
$rewardId = ($isWin === 1 && $superWinCoin > 0) ? 0 : $targetIndex;
|
|
||||||
$configName = $config !== null ? (string) ($config->name ?? '') : '自定义';
|
$configName = $config !== null ? (string) ($config->name ?? '') : '自定义';
|
||||||
$costRealEv = $realEv + ($isWin === 1 ? $bigWinRealEv : 0.0);
|
$costRealEv = $realEv + ($isWin === 1 ? $bigWinRealEv : 0.0);
|
||||||
$paidAmount = $lotteryType === 0 ? ($ante * self::UNIT_COST) : 0;
|
$paidAmount = $lotteryType === 0 ? round($ante * self::UNIT_COST, 2) : 0.0;
|
||||||
|
$rewardTier = ($isWin === 1 && $superWinCoin > 0) ? 'BIGWIN' : (string) ($tier ?? '');
|
||||||
|
// 与写入记录的 reward_tier 完全一致:仅当展示档位为 T5(非豹子大奖)时触发「再来一次」链式免费局
|
||||||
|
$grantsFreeTicket = ($rewardTier === 'T5');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'player_id' => 0,
|
'player_id' => 0,
|
||||||
@@ -635,20 +748,19 @@ class PlayStartLogic
|
|||||||
'paid_amount' => $paidAmount,
|
'paid_amount' => $paidAmount,
|
||||||
'super_win_coin' => $superWinCoin,
|
'super_win_coin' => $superWinCoin,
|
||||||
'reward_win_coin' => $rewardWinCoin,
|
'reward_win_coin' => $rewardWinCoin,
|
||||||
'use_coins' => $paidAmount,
|
|
||||||
'direction' => $direction,
|
'direction' => $direction,
|
||||||
'reward_config_id' => $rewardId,
|
'reward_tier' => $rewardTier,
|
||||||
'start_index' => $startIndex,
|
'start_index' => $startIndex,
|
||||||
'target_index' => $targetIndex,
|
'target_index' => $targetIndex,
|
||||||
'roll_array' => json_encode($rollArray),
|
'roll_array' => json_encode($rollArray),
|
||||||
'roll_number' => array_sum($rollArray),
|
'roll_number' => array_sum($rollArray),
|
||||||
'lottery_name' => $configName,
|
|
||||||
'status' => self::RECORD_STATUS_SUCCESS,
|
'status' => self::RECORD_STATUS_SUCCESS,
|
||||||
'tier' => $tier,
|
'tier' => $tier,
|
||||||
'roll_number_for_count' => $rollNumber,
|
'roll_number_for_count' => $rollNumber,
|
||||||
'real_ev' => $realEv,
|
'real_ev' => $realEv,
|
||||||
'bigwin_real_ev' => $isWin === 1 ? $bigWinRealEv : 0.0,
|
'bigwin_real_ev' => $isWin === 1 ? $bigWinRealEv : 0.0,
|
||||||
'cost_ev' => $costRealEv,
|
'cost_ev' => $costRealEv,
|
||||||
|
'grants_free_ticket' => $grantsFreeTicket,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,7 +174,10 @@ class UserLogic
|
|||||||
UserCache::setPlayerByUsername($username, $userArr);
|
UserCache::setPlayerByUsername($username, $userArr);
|
||||||
|
|
||||||
$baseUrl = rtrim(config('api.login_url_base', 'https://127.0.0.1:6777'), '/');
|
$baseUrl = rtrim(config('api.login_url_base', 'https://127.0.0.1:6777'), '/');
|
||||||
$lang = in_array($lang, ['chs', 'en'], true) ? $lang : 'chs';
|
$lang = strtolower(trim($lang));
|
||||||
|
if ($lang !== 'en') {
|
||||||
|
$lang = 'zh';
|
||||||
|
}
|
||||||
$tokenInUrl = str_replace('%3D', '=', urlencode($token));
|
$tokenInUrl = str_replace('%3D', '=', urlencode($token));
|
||||||
$url = $baseUrl . '?token=' . $tokenInUrl . '&lang=' . $lang;
|
$url = $baseUrl . '?token=' . $tokenInUrl . '&lang=' . $lang;
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,17 @@ class ApiLang
|
|||||||
return (string) $map[$key];
|
return (string) $map[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 兼容旧版:历史代码直接抛中文 message,lang=en 时从 legacy_en.php 映射到英文
|
||||||
|
if ($lang === self::LANG_EN) {
|
||||||
|
$legacy = self::loadLegacyEnMessages();
|
||||||
|
if (isset($legacy[$message])) {
|
||||||
|
return (string) $legacy[$message];
|
||||||
|
}
|
||||||
|
if ($key !== null && isset($legacy[$key])) {
|
||||||
|
return (string) $legacy[$key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,6 +119,22 @@ class ApiLang
|
|||||||
return 'MSG_' . strtoupper(sprintf('%08X', crc32($trim)));
|
return 'MSG_' . strtoupper(sprintf('%08X', crc32($trim)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载中文原文 => 英文 的兼容映射(仅 lang=en 使用)
|
||||||
|
* @return array<string, string>
|
||||||
|
*/
|
||||||
|
private static function loadLegacyEnMessages(): array
|
||||||
|
{
|
||||||
|
$path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR . 'legacy_en.php';
|
||||||
|
if (is_file($path)) {
|
||||||
|
$data = require $path;
|
||||||
|
if (is_array($data)) {
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 带占位符的翻译,如 translateParams('当前玩家余额%s小于%s无法继续游戏', [$coin, $minCoin])
|
* 带占位符的翻译,如 translateParams('当前玩家余额%s小于%s无法继续游戏', [$coin, $minCoin])
|
||||||
* 先翻译再替换(en 文案使用 %s 占位)
|
* 先翻译再替换(en 文案使用 %s 占位)
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ use app\dice\logic\play_record\DicePlayRecordLogic;
|
|||||||
use app\dice\validate\play_record\DicePlayRecordValidate;
|
use app\dice\validate\play_record\DicePlayRecordValidate;
|
||||||
use app\dice\model\player\DicePlayer;
|
use app\dice\model\player\DicePlayer;
|
||||||
use app\dice\model\lottery_pool_config\DiceLotteryPoolConfig;
|
use app\dice\model\lottery_pool_config\DiceLotteryPoolConfig;
|
||||||
use app\dice\model\reward\DiceRewardConfig;
|
|
||||||
use plugin\saiadmin\service\Permission;
|
use plugin\saiadmin\service\Permission;
|
||||||
use support\Request;
|
use support\Request;
|
||||||
use support\Response;
|
use support\Response;
|
||||||
@@ -57,16 +56,15 @@ class DicePlayRecordController extends BaseController
|
|||||||
AdminScopeHelper::applyAdminScope($query, $this->adminInfo ?? null);
|
AdminScopeHelper::applyAdminScope($query, $this->adminInfo ?? null);
|
||||||
$query->with([
|
$query->with([
|
||||||
'dicePlayer',
|
'dicePlayer',
|
||||||
'diceRewardConfig',
|
|
||||||
'diceLotteryPoolConfig',
|
'diceLotteryPoolConfig',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 按当前筛选条件统计:平台总盈利 = 付费抽奖(lottery_type=0)次数×100 - 玩家总收益(win_coin 求和)
|
// 按当前筛选条件统计:平台总盈利 = 付费金额(paid_amount 求和) - 玩家总收益(win_coin 求和)
|
||||||
$sumQuery = clone $query;
|
$sumQuery = clone $query;
|
||||||
$playerTotalWin = (float) $sumQuery->sum('win_coin');
|
$playerTotalWin = (float) $sumQuery->sum('win_coin');
|
||||||
$paidAmountQuery = clone $query;
|
$paidAmountQuery = clone $query;
|
||||||
$paidAmount = (float) $paidAmountQuery->where('lottery_type', 0)->sum('paid_amount');
|
$paidAmount = (float) $paidAmountQuery->where('lottery_type', 0)->sum('paid_amount');
|
||||||
$totalWinCoin = $paidAmount - $playerTotalWin;
|
$totalWinCoin = round($paidAmount - $playerTotalWin, 2);
|
||||||
|
|
||||||
$data = $this->logic->getList($query);
|
$data = $this->logic->getList($query);
|
||||||
$data['total_win_coin'] = $totalWinCoin;
|
$data['total_win_coin'] = $totalWinCoin;
|
||||||
@@ -101,23 +99,6 @@ class DicePlayRecordController extends BaseController
|
|||||||
return $this->success($data);
|
return $this->success($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取奖励配置选项(id、ui_text、tier)
|
|
||||||
*/
|
|
||||||
#[Permission('玩家抽奖记录列表', 'dice:play_record:index:index')]
|
|
||||||
public function getRewardConfigOptions(Request $request): Response
|
|
||||||
{
|
|
||||||
$list = DiceRewardConfig::field('id,ui_text,tier')->select();
|
|
||||||
$data = $list->map(function ($item) {
|
|
||||||
return [
|
|
||||||
'id' => $item['id'],
|
|
||||||
'ui_text' => $item['ui_text'] ?? '',
|
|
||||||
'tier' => $item['tier'] ?? ''
|
|
||||||
];
|
|
||||||
})->toArray();
|
|
||||||
return $this->success($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 读取数据
|
* 读取数据
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class DicePlayRecordTestController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据列表,并在结果中附带当前筛选条件下测试数据的平台总盈利 total_win_coin(付费抽奖次数×100 - 玩家总收益)
|
* 数据列表,并在结果中附带当前筛选条件下测试数据的平台总盈利 total_win_coin(付费金额 paid_amount 求和 - 玩家总收益)
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
@@ -50,14 +50,14 @@ class DicePlayRecordTestController extends BaseController
|
|||||||
['roll_number', ''],
|
['roll_number', ''],
|
||||||
]);
|
]);
|
||||||
$query = $this->logic->search($where);
|
$query = $this->logic->search($where);
|
||||||
$query->with(['diceLotteryPoolConfig', 'diceRewardConfig']);
|
$query->with(['diceLotteryPoolConfig']);
|
||||||
|
|
||||||
// 按当前筛选条件统计:平台总盈利 = 付费金额(paid_amount 求和) - 玩家总收益(win_coin 求和)
|
// 按当前筛选条件统计:平台总盈利 = 付费金额(paid_amount 求和) - 玩家总收益(win_coin 求和)
|
||||||
$sumQuery = clone $query;
|
$sumQuery = clone $query;
|
||||||
$playerTotalWin = (float) $sumQuery->sum('win_coin');
|
$playerTotalWin = (float) $sumQuery->sum('win_coin');
|
||||||
$paidAmountQuery = clone $query;
|
$paidAmountQuery = clone $query;
|
||||||
$paidAmount = (float) $paidAmountQuery->where('lottery_type', 0)->sum('paid_amount');
|
$paidAmount = (float) $paidAmountQuery->where('lottery_type', 0)->sum('paid_amount');
|
||||||
$totalWinCoin = $paidAmount - $playerTotalWin;
|
$totalWinCoin = round($paidAmount - $playerTotalWin, 2);
|
||||||
|
|
||||||
$data = $this->logic->getList($query);
|
$data = $this->logic->getList($query);
|
||||||
$data['total_win_coin'] = $totalWinCoin;
|
$data['total_win_coin'] = $totalWinCoin;
|
||||||
|
|||||||
@@ -81,9 +81,11 @@ class DiceRewardController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一键测试权重:创建测试记录并启动单进程后台执行,按付费/免费、顺逆方向交替写入 dice_play_record_test
|
* 一键测试权重:创建测试记录并启动单进程后台执行,写入 dice_play_record_test
|
||||||
* 参数:lottery_config_id 可选,不选则传 paid_tier_weights / free_tier_weights 自定义档位;
|
* 参数:lottery_config_id 可选;paid_tier_weights / free_tier_weights 自定义档位;
|
||||||
* paid_s_count, paid_n_count, free_s_count, free_n_count;或兼容旧版 s_count, n_count
|
* paid_s_count, paid_n_count
|
||||||
|
* chain_free_mode=1:仅按付费次数模拟;付费抽到再来一次/T5 则在队列中插入免费局(同底注、lottery_type=免费、paid_amount=0)
|
||||||
|
* kill_mode_enabled=1:测试内启用杀分;当模拟玩家累计盈利达到 test_safety_line 后,付费抽奖切到 killScore
|
||||||
*/
|
*/
|
||||||
#[Permission('一键测试权重', 'dice:reward:index:startWeightTest')]
|
#[Permission('一键测试权重', 'dice:reward:index:startWeightTest')]
|
||||||
public function startWeightTest(Request $request): Response
|
public function startWeightTest(Request $request): Response
|
||||||
@@ -94,14 +96,13 @@ class DiceRewardController extends BaseController
|
|||||||
'lottery_config_id' => $post['lottery_config_id'] ?? null,
|
'lottery_config_id' => $post['lottery_config_id'] ?? null,
|
||||||
'paid_lottery_config_id' => $post['paid_lottery_config_id'] ?? null,
|
'paid_lottery_config_id' => $post['paid_lottery_config_id'] ?? null,
|
||||||
'free_lottery_config_id' => $post['free_lottery_config_id'] ?? null,
|
'free_lottery_config_id' => $post['free_lottery_config_id'] ?? null,
|
||||||
's_count' => $post['s_count'] ?? null,
|
|
||||||
'n_count' => $post['n_count'] ?? null,
|
|
||||||
'paid_s_count' => $post['paid_s_count'] ?? null,
|
'paid_s_count' => $post['paid_s_count'] ?? null,
|
||||||
'paid_n_count' => $post['paid_n_count'] ?? null,
|
'paid_n_count' => $post['paid_n_count'] ?? null,
|
||||||
'free_s_count' => $post['free_s_count'] ?? null,
|
|
||||||
'free_n_count' => $post['free_n_count'] ?? null,
|
|
||||||
'paid_tier_weights' => $post['paid_tier_weights'] ?? null,
|
'paid_tier_weights' => $post['paid_tier_weights'] ?? null,
|
||||||
'free_tier_weights' => $post['free_tier_weights'] ?? null,
|
'free_tier_weights' => $post['free_tier_weights'] ?? null,
|
||||||
|
'chain_free_mode' => $post['chain_free_mode'] ?? null,
|
||||||
|
'kill_mode_enabled' => $post['kill_mode_enabled'] ?? null,
|
||||||
|
'test_safety_line' => $post['test_safety_line'] ?? null,
|
||||||
];
|
];
|
||||||
$adminId = isset($this->adminInfo['id']) ? (int) $this->adminInfo['id'] : null;
|
$adminId = isset($this->adminInfo['id']) ? (int) $this->adminInfo['id'] : null;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ class DiceRewardConfigRecordController extends BaseController
|
|||||||
public function index(Request $request): Response
|
public function index(Request $request): Response
|
||||||
{
|
{
|
||||||
$where = $request->more([
|
$where = $request->more([
|
||||||
|
['paid_planned_spins', ''],
|
||||||
|
['ante', ''],
|
||||||
]);
|
]);
|
||||||
$query = $this->logic->search($where);
|
$query = $this->logic->search($where);
|
||||||
$data = $this->logic->getList($query);
|
$data = $this->logic->getList($query);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use plugin\saiadmin\app\model\system\SystemUser;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 奖励配置权重测试记录逻辑层
|
* 奖励配置权重测试记录逻辑层
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
class DiceRewardConfigRecordLogic extends BaseLogic
|
class DiceRewardConfigRecordLogic extends BaseLogic
|
||||||
{
|
{
|
||||||
@@ -229,10 +230,10 @@ class DiceRewardConfigRecordLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建一键测试权重记录并返回 ID,供后台执行器按付费/免费、顺逆方向交替写入 dice_play_record_test
|
* 创建一键测试权重记录并返回 ID,供后台执行器写入 dice_play_record_test
|
||||||
* 支持两种模式:1)选择奖池配置 lottery_config_id,档位概率取自配置;2)不选配置,使用自定义 paid_tier_weights / free_tier_weights
|
* 支持两种模式:1)选择奖池配置 lottery_config_id,档位概率取自配置;2)不选配置,使用自定义 paid_tier_weights / free_tier_weights
|
||||||
* @param array|int $params 数组:lottery_config_id(可选), paid_s_count, paid_n_count, free_s_count, free_n_count;或兼容旧版传 4 个 int 时视为 (paid_s_count, paid_n_count, free_s_count, free_n_count)
|
* @param array|int $params 数组:lottery_config_id(可选), paid_s_count, paid_n_count
|
||||||
* @param int|null $adminId 执行人(旧版 4 参调用时第二参为 paid_n_count,此处不传 adminId)
|
* @param int|null $adminId 执行人
|
||||||
* @return int 记录 ID
|
* @return int 记录 ID
|
||||||
* @throws ApiException
|
* @throws ApiException
|
||||||
*/
|
*/
|
||||||
@@ -240,12 +241,10 @@ class DiceRewardConfigRecordLogic extends BaseLogic
|
|||||||
{
|
{
|
||||||
$adminId = null;
|
$adminId = null;
|
||||||
if (!is_array($params)) {
|
if (!is_array($params)) {
|
||||||
// 兼容旧版调用:createWeightTestRecord(paid_s_count, paid_n_count, free_s_count, free_n_count)
|
// 兼容旧版调用:createWeightTestRecord(paid_s_count, paid_n_count)
|
||||||
$params = [
|
$params = [
|
||||||
'paid_s_count' => (int) $params,
|
'paid_s_count' => (int) $params,
|
||||||
'paid_n_count' => (int) $adminIdOrFreeS,
|
'paid_n_count' => (int) $adminIdOrFreeS,
|
||||||
'free_s_count' => (int) $freeSOrFreeN,
|
|
||||||
'free_n_count' => (int) $freeN,
|
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
$adminId = $adminIdOrFreeS !== null && $adminIdOrFreeS !== '' ? (int) $adminIdOrFreeS : null;
|
$adminId = $adminIdOrFreeS !== null && $adminIdOrFreeS !== '' ? (int) $adminIdOrFreeS : null;
|
||||||
@@ -269,19 +268,23 @@ class DiceRewardConfigRecordLogic extends BaseLogic
|
|||||||
if ($freeConfigId <= 0 && $lotteryConfigId > 0) {
|
if ($freeConfigId <= 0 && $lotteryConfigId > 0) {
|
||||||
$freeConfigId = $lotteryConfigId;
|
$freeConfigId = $lotteryConfigId;
|
||||||
}
|
}
|
||||||
$paidS = isset($params['paid_s_count']) ? (int) $params['paid_s_count'] : (int) ($params['s_count'] ?? 0);
|
$paidS = isset($params['paid_s_count']) ? (int) $params['paid_s_count'] : 0;
|
||||||
$paidN = isset($params['paid_n_count']) ? (int) $params['paid_n_count'] : (int) ($params['n_count'] ?? 0);
|
$paidN = isset($params['paid_n_count']) ? (int) $params['paid_n_count'] : 0;
|
||||||
$freeS = (int) ($params['free_s_count'] ?? 0);
|
$chainFreeMode = !empty($params['chain_free_mode']);
|
||||||
$freeN = (int) ($params['free_n_count'] ?? 0);
|
$killModeEnabled = !empty($params['kill_mode_enabled']);
|
||||||
|
$testSafetyLine = isset($params['test_safety_line']) ? (int) $params['test_safety_line'] : 5000;
|
||||||
|
if ($testSafetyLine < 0) {
|
||||||
|
throw new ApiException('test_safety_line must be greater than or equal to 0');
|
||||||
|
}
|
||||||
|
|
||||||
foreach ([$paidS, $paidN, $freeS, $freeN] as $c) {
|
foreach ([$paidS, $paidN] as $c) {
|
||||||
if ($c !== 0 && !in_array($c, $allowed, true)) {
|
if ($c !== 0 && !in_array($c, $allowed, true)) {
|
||||||
throw new ApiException('Counts only support 0, 100, 500, 1000, 5000');
|
throw new ApiException('Counts only support 0, 100, 500, 1000, 5000');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$total = $paidS + $paidN + $freeS + $freeN;
|
$total = $paidS + $paidN;
|
||||||
if ($total <= 0) {
|
if ($total <= 0) {
|
||||||
throw new ApiException('Sum of paid/free direction counts must be greater than 0');
|
throw new ApiException('Sum of paid direction counts must be greater than 0');
|
||||||
}
|
}
|
||||||
|
|
||||||
$snapshot = [];
|
$snapshot = [];
|
||||||
@@ -394,24 +397,30 @@ class DiceRewardConfigRecordLogic extends BaseLogic
|
|||||||
if (!is_array($tierWeightsSnapshot['free'])) {
|
if (!is_array($tierWeightsSnapshot['free'])) {
|
||||||
$tierWeightsSnapshot['free'] = [];
|
$tierWeightsSnapshot['free'] = [];
|
||||||
}
|
}
|
||||||
|
if ($chainFreeMode) {
|
||||||
|
$tierWeightsSnapshot['chain_free_mode'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
$record = new DiceRewardConfigRecord();
|
$record = new DiceRewardConfigRecord();
|
||||||
$record->test_count = $total;
|
$plannedPaidSpins = $paidS + $paidN;
|
||||||
|
$record->chain_free_mode = $chainFreeMode ? 1 : 0;
|
||||||
|
$record->kill_mode_enabled = $killModeEnabled ? 1 : 0;
|
||||||
|
$record->test_safety_line = $testSafetyLine;
|
||||||
|
$record->paid_planned_spins = $plannedPaidSpins;
|
||||||
|
// 总抽奖次数与 test_count 仅在任务成功结束时写入(见 WeightTestRunner::markSuccess)
|
||||||
|
$record->test_count = 0;
|
||||||
|
$record->total_play_count = 0;
|
||||||
$record->weight_config_snapshot = $snapshot;
|
$record->weight_config_snapshot = $snapshot;
|
||||||
$record->tier_weights_snapshot = $tierWeightsSnapshot;
|
$record->tier_weights_snapshot = $tierWeightsSnapshot;
|
||||||
$record->lottery_config_id = $lotteryConfigId > 0 ? $lotteryConfigId : null;
|
$record->lottery_config_id = $lotteryConfigId > 0 ? $lotteryConfigId : null;
|
||||||
$record->paid_lottery_config_id = $paidConfigId > 0 ? $paidConfigId : null;
|
$record->paid_lottery_config_id = $paidConfigId > 0 ? $paidConfigId : null;
|
||||||
$record->free_lottery_config_id = $freeConfigId > 0 ? $freeConfigId : null;
|
$record->free_lottery_config_id = $freeConfigId > 0 ? $freeConfigId : null;
|
||||||
$record->total_play_count = $total;
|
|
||||||
$record->over_play_count = 0;
|
$record->over_play_count = 0;
|
||||||
$record->status = DiceRewardConfigRecord::STATUS_RUNNING;
|
$record->status = DiceRewardConfigRecord::STATUS_RUNNING;
|
||||||
$record->remark = null;
|
$record->remark = null;
|
||||||
$record->s_count = $paidS + $paidN;
|
|
||||||
$record->n_count = $freeS + $freeN;
|
|
||||||
$record->paid_s_count = $paidS;
|
$record->paid_s_count = $paidS;
|
||||||
$record->paid_n_count = $paidN;
|
$record->paid_n_count = $paidN;
|
||||||
$record->free_s_count = $freeS;
|
$record->play_again_count = 0;
|
||||||
$record->free_n_count = $freeN;
|
|
||||||
$record->paid_tier_weights = $paidTierWeights;
|
$record->paid_tier_weights = $paidTierWeights;
|
||||||
$record->free_tier_weights = $freeTierWeights;
|
$record->free_tier_weights = $freeTierWeights;
|
||||||
$record->result_counts = [];
|
$record->result_counts = [];
|
||||||
|
|||||||
@@ -14,15 +14,34 @@ use support\think\Db;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 一键测试权重:单进程后台执行模拟摇色子,写入 dice_play_record_test 并更新 dice_reward_config_record 进度
|
* 一键测试权重:单进程后台执行模拟摇色子,写入 dice_play_record_test 并更新 dice_reward_config_record 进度
|
||||||
* 抽奖逻辑与 PlayStartLogic 一致:使用 name=default 的安全线、杀分开关;盈利<安全线时付费用玩家权重、免费用 killScore;盈利>=安全线且杀分开启时付费/免费均用 killScore
|
* 支持测试内杀分:当模拟玩家累计盈利达到安全线后,付费抽奖切换到 killScore
|
||||||
*/
|
*/
|
||||||
class WeightTestRunner
|
class WeightTestRunner
|
||||||
{
|
{
|
||||||
private const BATCH_SIZE = 10;
|
private const BATCH_SIZE = 10;
|
||||||
|
/** 测试记录写库白名单字段 */
|
||||||
|
private const PLAY_RECORD_TEST_COLUMNS = [
|
||||||
|
'reward_config_record_id',
|
||||||
|
'admin_id',
|
||||||
|
'lottery_config_id',
|
||||||
|
'lottery_type',
|
||||||
|
'is_win',
|
||||||
|
'win_coin',
|
||||||
|
'super_win_coin',
|
||||||
|
'reward_win_coin',
|
||||||
|
'direction',
|
||||||
|
'reward_tier',
|
||||||
|
'ante',
|
||||||
|
'paid_amount',
|
||||||
|
'start_index',
|
||||||
|
'target_index',
|
||||||
|
'roll_array',
|
||||||
|
'roll_number',
|
||||||
|
'status',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行指定测试记录:按付费/免费、顺/逆方向交替模拟(付费顺→付费逆→免费顺→免费逆),每 10 条写入一次测试表并更新进度
|
* 执行指定测试记录:按付费次数模拟,若命中 T5 则链式插入免费局(同方向同底注)
|
||||||
* 使用与 playStart 相同的彩金池逻辑:name=default 的安全线/kill_enabled;付费用 paid_tier_weights(玩家权重)或 killScore;免费用 killScore
|
|
||||||
* @param int $recordId dice_reward_config_record.id
|
* @param int $recordId dice_reward_config_record.id
|
||||||
*/
|
*/
|
||||||
public function run(int $recordId): void
|
public function run(int $recordId): void
|
||||||
@@ -36,21 +55,11 @@ class WeightTestRunner
|
|||||||
$ante = is_numeric($record->ante ?? null) ? intval($record->ante) : 1;
|
$ante = is_numeric($record->ante ?? null) ? intval($record->ante) : 1;
|
||||||
$paidS = (int) ($record->paid_s_count ?? 0);
|
$paidS = (int) ($record->paid_s_count ?? 0);
|
||||||
$paidN = (int) ($record->paid_n_count ?? 0);
|
$paidN = (int) ($record->paid_n_count ?? 0);
|
||||||
$freeS = (int) ($record->free_s_count ?? 0);
|
$total = $paidS + $paidN;
|
||||||
$freeN = (int) ($record->free_n_count ?? 0);
|
|
||||||
if ($paidS + $paidN + $freeS + $freeN <= 0) {
|
|
||||||
$sCount = (int) ($record->s_count ?? 0);
|
|
||||||
$nCount = (int) ($record->n_count ?? 0);
|
|
||||||
$total = $sCount + $nCount;
|
|
||||||
if ($total <= 0) {
|
if ($total <= 0) {
|
||||||
$this->markFailed($recordId, '抽奖次数必须大于 0');
|
$this->markFailed($recordId, '抽奖次数必须大于 0');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$paidS = $sCount;
|
|
||||||
$paidN = $nCount;
|
|
||||||
} else {
|
|
||||||
$total = $paidS + $paidN + $freeS + $freeN;
|
|
||||||
}
|
|
||||||
|
|
||||||
$configType0 = DiceLotteryPoolConfig::where('name', 'default')->find();
|
$configType0 = DiceLotteryPoolConfig::where('name', 'default')->find();
|
||||||
$configType1 = DiceLotteryPoolConfig::where('name', 'killScore')->find();
|
$configType1 = DiceLotteryPoolConfig::where('name', 'killScore')->find();
|
||||||
@@ -58,8 +67,6 @@ class WeightTestRunner
|
|||||||
$this->markFailed($recordId, '彩金池配置 name=default 不存在');
|
$this->markFailed($recordId, '彩金池配置 name=default 不存在');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$safetyLine = (int) ($configType0->safety_line ?? 0);
|
|
||||||
$killEnabled = ((int) ($configType0->kill_enabled ?? 1)) === 1;
|
|
||||||
|
|
||||||
$paidTierWeightsCustom = (is_array($record->paid_tier_weights ?? null) && $record->paid_tier_weights !== [])
|
$paidTierWeightsCustom = (is_array($record->paid_tier_weights ?? null) && $record->paid_tier_weights !== [])
|
||||||
? $record->paid_tier_weights
|
? $record->paid_tier_weights
|
||||||
@@ -93,8 +100,14 @@ class WeightTestRunner
|
|||||||
DiceRewardConfig::clearRequestInstance();
|
DiceRewardConfig::clearRequestInstance();
|
||||||
DiceReward::clearRequestInstance();
|
DiceReward::clearRequestInstance();
|
||||||
|
|
||||||
// 彩金池累计盈利:用于判断是否触发杀分(不再依赖单个玩家累计盈利)
|
$killModeEnabled = (int) ($record->kill_mode_enabled ?? 0) === 1;
|
||||||
$poolProfitTotal = floatval($configType0->profit_amount ?? 0);
|
$testSafetyLine = (int) ($record->test_safety_line ?? 5000);
|
||||||
|
if ($testSafetyLine < 0) {
|
||||||
|
$testSafetyLine = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 测试内“玩家累计盈利”:用于控制付费局是否切换杀分
|
||||||
|
$playerProfitTotal = 0.0;
|
||||||
|
|
||||||
$playLogic = new PlayStartLogic();
|
$playLogic = new PlayStartLogic();
|
||||||
$resultCounts = [];
|
$resultCounts = [];
|
||||||
@@ -103,53 +116,29 @@ class WeightTestRunner
|
|||||||
$done = 0;
|
$done = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for ($i = 0; $i < $paidS; $i++) {
|
$this->runChainFreeMode(
|
||||||
$usePoolWeights = $killEnabled && $poolProfitTotal >= $safetyLine && $configType1 !== null;
|
$recordId,
|
||||||
$paidConfig = $usePoolWeights ? $configType1 : $paidPoolConfig;
|
$playLogic,
|
||||||
$customWeights = $usePoolWeights ? null : $paidTierWeightsCustom;
|
$paidS,
|
||||||
$row = $playLogic->simulateOnePlay($paidConfig, 0, 0, $ante, $customWeights);
|
$paidN,
|
||||||
$this->accumulateProfitForDefault($row, 0, $paidConfig, $configType0, $poolProfitTotal);
|
$ante,
|
||||||
$this->aggregate($row, $resultCounts, $tierCounts);
|
$paidPoolConfig,
|
||||||
$buffer[] = $this->rowForInsert($row, $recordId);
|
$freePoolConfig,
|
||||||
$done++;
|
$configType1,
|
||||||
$this->flushIfNeeded($buffer, $recordId, $done, $total, $resultCounts, $tierCounts);
|
$paidTierWeightsCustom,
|
||||||
}
|
$freeTierWeightsCustom,
|
||||||
for ($i = 0; $i < $paidN; $i++) {
|
$killModeEnabled,
|
||||||
$usePoolWeights = $killEnabled && $poolProfitTotal >= $safetyLine && $configType1 !== null;
|
$testSafetyLine,
|
||||||
$paidConfig = $usePoolWeights ? $configType1 : $paidPoolConfig;
|
$playerProfitTotal,
|
||||||
$customWeights = $usePoolWeights ? null : $paidTierWeightsCustom;
|
$resultCounts,
|
||||||
$row = $playLogic->simulateOnePlay($paidConfig, 1, 0, $ante, $customWeights);
|
$tierCounts,
|
||||||
$this->accumulateProfitForDefault($row, 0, $paidConfig, $configType0, $poolProfitTotal);
|
$buffer,
|
||||||
$this->aggregate($row, $resultCounts, $tierCounts);
|
$done
|
||||||
$buffer[] = $this->rowForInsert($row, $recordId);
|
);
|
||||||
$done++;
|
|
||||||
$this->flushIfNeeded($buffer, $recordId, $done, $total, $resultCounts, $tierCounts);
|
|
||||||
}
|
|
||||||
for ($i = 0; $i < $freeS; $i++) {
|
|
||||||
$useKillMode = $killEnabled && $poolProfitTotal >= $safetyLine && $configType1 !== null;
|
|
||||||
$freeConfig = $useKillMode ? $configType1 : $freePoolConfig;
|
|
||||||
$customWeights = $useKillMode ? null : $freeTierWeightsCustom;
|
|
||||||
$row = $playLogic->simulateOnePlay($freeConfig, 0, 1, $ante, $customWeights);
|
|
||||||
$this->accumulateProfitForDefault($row, 1, $freeConfig, $configType0, $poolProfitTotal);
|
|
||||||
$this->aggregate($row, $resultCounts, $tierCounts);
|
|
||||||
$buffer[] = $this->rowForInsert($row, $recordId);
|
|
||||||
$done++;
|
|
||||||
$this->flushIfNeeded($buffer, $recordId, $done, $total, $resultCounts, $tierCounts);
|
|
||||||
}
|
|
||||||
for ($i = 0; $i < $freeN; $i++) {
|
|
||||||
$useKillMode = $killEnabled && $poolProfitTotal >= $safetyLine && $configType1 !== null;
|
|
||||||
$freeConfig = $useKillMode ? $configType1 : $freePoolConfig;
|
|
||||||
$customWeights = $useKillMode ? null : $freeTierWeightsCustom;
|
|
||||||
$row = $playLogic->simulateOnePlay($freeConfig, 1, 1, $ante, $customWeights);
|
|
||||||
$this->accumulateProfitForDefault($row, 1, $freeConfig, $configType0, $poolProfitTotal);
|
|
||||||
$this->aggregate($row, $resultCounts, $tierCounts);
|
|
||||||
$buffer[] = $this->rowForInsert($row, $recordId);
|
|
||||||
$done++;
|
|
||||||
$this->flushIfNeeded($buffer, $recordId, $done, $total, $resultCounts, $tierCounts);
|
|
||||||
}
|
|
||||||
if (!empty($buffer)) {
|
if (!empty($buffer)) {
|
||||||
$this->insertBuffer($buffer);
|
$this->insertBuffer($buffer);
|
||||||
$this->updateProgress($recordId, $done, $resultCounts, $tierCounts);
|
// 链式/非链式:运行中均不写入 total_play_count,仅在 markSuccess 落库实际总次数
|
||||||
|
$this->updateProgress($recordId, $done, $resultCounts, $tierCounts, null);
|
||||||
}
|
}
|
||||||
// 平台赚取金额:通过关联 DicePlayRecordTest(reward_config_record_id)统计
|
// 平台赚取金额:通过关联 DicePlayRecordTest(reward_config_record_id)统计
|
||||||
$this->markSuccess($recordId, $resultCounts, $tierCounts);
|
$this->markSuccess($recordId, $resultCounts, $tierCounts);
|
||||||
@@ -160,20 +149,72 @@ class WeightTestRunner
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累加彩金池累计盈利,用于触发杀分,与 PlayStartLogic 一致
|
* 付费次数仅由配置决定;付费抽到「再来一次」则在队列末尾插入一条免费抽奖(同方向、同底注),可链式触发
|
||||||
* @param int $lotteryType 0=付费券,1=免费券
|
|
||||||
* @param object $usedConfig 本次使用的奖池配置(仅用于校验非空)
|
|
||||||
* @param object $configType0 name=default 的彩金池
|
|
||||||
* @param float $playerProfitTotal 实际为“彩金池累计盈利”滚动值
|
|
||||||
*/
|
*/
|
||||||
private function accumulateProfitForDefault(array $row, int $lotteryType, $usedConfig, $configType0, float &$playerProfitTotal): void
|
private function runChainFreeMode(
|
||||||
{
|
int $recordId,
|
||||||
if (($lotteryType !== 0 && $lotteryType !== 1) || $usedConfig === null || $configType0 === null || !isset($row['win_coin'])) {
|
PlayStartLogic $playLogic,
|
||||||
return;
|
int $paidS,
|
||||||
|
int $paidN,
|
||||||
|
int $ante,
|
||||||
|
$paidPoolConfig,
|
||||||
|
$freePoolConfig,
|
||||||
|
$killPoolConfig,
|
||||||
|
?array $paidTierWeightsCustom,
|
||||||
|
?array $freeTierWeightsCustom,
|
||||||
|
bool $killModeEnabled,
|
||||||
|
int $testSafetyLine,
|
||||||
|
float &$playerProfitTotal,
|
||||||
|
array &$resultCounts,
|
||||||
|
array &$tierCounts,
|
||||||
|
array &$buffer,
|
||||||
|
int &$done
|
||||||
|
): void {
|
||||||
|
$queue = [];
|
||||||
|
for ($i = 0; $i < $paidS; $i++) {
|
||||||
|
$queue[] = ['paid', 0, $ante];
|
||||||
}
|
}
|
||||||
$winCoin = (float) $row['win_coin'];
|
for ($i = 0; $i < $paidN; $i++) {
|
||||||
|
$queue[] = ['paid', 1, $ante];
|
||||||
|
}
|
||||||
|
$qi = 0;
|
||||||
|
while ($qi < count($queue)) {
|
||||||
|
$item = $queue[$qi];
|
||||||
|
$isPaid = $item[0] === 'paid';
|
||||||
|
$dir = $item[1];
|
||||||
|
$playAnte = $item[2];
|
||||||
|
$lotteryType = $isPaid ? 0 : 1;
|
||||||
|
|
||||||
|
if ($isPaid) {
|
||||||
|
$useKillForPaid = $killModeEnabled && $playerProfitTotal >= $testSafetyLine && $killPoolConfig !== null;
|
||||||
|
if ($useKillForPaid) {
|
||||||
|
$cfg = $killPoolConfig;
|
||||||
|
$customWeights = null;
|
||||||
|
} else {
|
||||||
|
$cfg = $paidPoolConfig;
|
||||||
|
$customWeights = $paidTierWeightsCustom;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$cfg = $freePoolConfig;
|
||||||
|
$customWeights = $freeTierWeightsCustom;
|
||||||
|
}
|
||||||
|
|
||||||
|
$row = $playLogic->simulateOnePlay($cfg, $dir, $lotteryType, $playAnte, $customWeights);
|
||||||
|
$winCoin = (float) ($row['win_coin'] ?? 0);
|
||||||
$paidAmount = (float) ($row['paid_amount'] ?? 0);
|
$paidAmount = (float) ($row['paid_amount'] ?? 0);
|
||||||
$playerProfitTotal += $lotteryType === 0 ? ($winCoin - $paidAmount) : $winCoin;
|
$playerProfitTotal += $winCoin - $paidAmount;
|
||||||
|
$this->aggregate($row, $resultCounts, $tierCounts);
|
||||||
|
$buffer[] = $this->rowForInsert($row, $recordId);
|
||||||
|
$done++;
|
||||||
|
|
||||||
|
if (!empty($row['grants_free_ticket'])) {
|
||||||
|
$queue[] = ['free', $dir, $playAnte];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->flushIfNeeded($buffer, $recordId, $done, count($queue), $resultCounts, $tierCounts, null);
|
||||||
|
|
||||||
|
$qi++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function aggregate(array $row, array &$resultCounts, array &$tierCounts): void
|
private function aggregate(array $row, array &$resultCounts, array &$tierCounts): void
|
||||||
@@ -194,10 +235,10 @@ class WeightTestRunner
|
|||||||
'reward_config_record_id' => $rewardConfigRecordId,
|
'reward_config_record_id' => $rewardConfigRecordId,
|
||||||
];
|
];
|
||||||
$keys = [
|
$keys = [
|
||||||
'player_id', 'admin_id', 'lottery_config_id', 'lottery_type', 'is_win', 'win_coin',
|
'admin_id', 'lottery_config_id', 'lottery_type', 'is_win', 'win_coin',
|
||||||
'super_win_coin', 'reward_win_coin', 'use_coins', 'direction', 'reward_config_id',
|
'super_win_coin', 'reward_win_coin', 'direction', 'reward_tier',
|
||||||
'ante', 'paid_amount',
|
'ante', 'paid_amount',
|
||||||
'start_index', 'target_index', 'roll_array', 'roll_number', 'lottery_name', 'status',
|
'start_index', 'target_index', 'roll_array', 'roll_number', 'status',
|
||||||
];
|
];
|
||||||
foreach ($keys as $k) {
|
foreach ($keys as $k) {
|
||||||
if (array_key_exists($k, $row)) {
|
if (array_key_exists($k, $row)) {
|
||||||
@@ -207,14 +248,14 @@ class WeightTestRunner
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function flushIfNeeded(array &$buffer, int $recordId, int $done, int $total, array $resultCounts, array $tierCounts): void
|
private function flushIfNeeded(array &$buffer, int $recordId, int $done, int $total, array $resultCounts, array $tierCounts, ?int $recordTotalPlayCount = null): void
|
||||||
{
|
{
|
||||||
if (count($buffer) < self::BATCH_SIZE) {
|
if (count($buffer) < self::BATCH_SIZE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->insertBuffer($buffer);
|
$this->insertBuffer($buffer);
|
||||||
$buffer = [];
|
$buffer = [];
|
||||||
$this->updateProgress($recordId, $done, $resultCounts, $tierCounts);
|
$this->updateProgress($recordId, $done, $resultCounts, $tierCounts, $recordTotalPlayCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function insertBuffer(array $rows): void
|
private function insertBuffer(array $rows): void
|
||||||
@@ -223,15 +264,36 @@ class WeightTestRunner
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
DicePlayRecordTest::create($row);
|
if (!is_array($row)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$payload = [];
|
||||||
|
foreach (self::PLAY_RECORD_TEST_COLUMNS as $column) {
|
||||||
|
if (array_key_exists($column, $row)) {
|
||||||
|
$payload[$column] = $row[$column];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!array_key_exists('create_time', $payload) || $payload['create_time'] === null || $payload['create_time'] === '') {
|
||||||
|
$payload['create_time'] = date('Y-m-d H:i:s');
|
||||||
|
}
|
||||||
|
if (!array_key_exists('update_time', $payload) || $payload['update_time'] === null || $payload['update_time'] === '') {
|
||||||
|
$payload['update_time'] = $payload['create_time'];
|
||||||
|
}
|
||||||
|
if ($payload === []) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Db::name((new DicePlayRecordTest())->getTable())->insert($payload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function updateProgress(int $recordId, int $overPlayCount, array $resultCounts, array $tierCounts): void
|
private function updateProgress(int $recordId, int $overPlayCount, array $resultCounts, array $tierCounts, ?int $totalPlayCount = null): void
|
||||||
{
|
{
|
||||||
$record = DiceRewardConfigRecord::find($recordId);
|
$record = DiceRewardConfigRecord::find($recordId);
|
||||||
if ($record) {
|
if ($record) {
|
||||||
$record->over_play_count = $overPlayCount;
|
$record->over_play_count = $overPlayCount;
|
||||||
|
if ($totalPlayCount !== null) {
|
||||||
|
$record->total_play_count = $totalPlayCount;
|
||||||
|
}
|
||||||
$record->result_counts = $resultCounts;
|
$record->result_counts = $resultCounts;
|
||||||
$record->tier_counts = $tierCounts;
|
$record->tier_counts = $tierCounts;
|
||||||
$record->save();
|
$record->save();
|
||||||
@@ -256,6 +318,10 @@ class WeightTestRunner
|
|||||||
$record->tier_counts = $tierCounts;
|
$record->tier_counts = $tierCounts;
|
||||||
$record->remark = null;
|
$record->remark = null;
|
||||||
$record->platform_profit = $platformProfit;
|
$record->platform_profit = $platformProfit;
|
||||||
|
$record->play_again_count = DiceRewardConfigRecord::computePlayAgainCountFromRelated($recordId);
|
||||||
|
$actualCount = (int) DicePlayRecordTest::where('reward_config_record_id', $recordId)->count();
|
||||||
|
$record->total_play_count = $actualCount;
|
||||||
|
$record->test_count = $actualCount;
|
||||||
$record->save();
|
$record->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,14 +23,14 @@ use think\model\relation\BelongsTo;
|
|||||||
* @property $lottery_config_id 彩金池配置
|
* @property $lottery_config_id 彩金池配置
|
||||||
* @property $lottery_type 抽奖类型
|
* @property $lottery_type 抽奖类型
|
||||||
* @property $ante 底注/注数(dice_ante_config.mult)
|
* @property $ante 底注/注数(dice_ante_config.mult)
|
||||||
* @property $paid_amount 付费金额(付费局=ante*100,免费局=0)
|
* @property $paid_amount 付费金额(付费局=ante*1,免费局=0)
|
||||||
* @property $is_win 是否中大奖:豹子号[1,1,1,1,1]~[6,6,6,6,6]为1,否则0
|
* @property $is_win 是否中大奖:豹子号[1,1,1,1,1]~[6,6,6,6,6]为1,否则0
|
||||||
* @property $win_coin 赢取平台币(= super_win_coin + reward_win_coin)
|
* @property $win_coin 赢取平台币(= super_win_coin + reward_win_coin)
|
||||||
* @property $super_win_coin 中大奖平台币(豹子时发放)
|
* @property $super_win_coin 中大奖平台币(豹子时发放)
|
||||||
* @property $reward_win_coin 摇色子中奖平台币
|
* @property $reward_win_coin 摇色子中奖平台币
|
||||||
* @property $use_coins 消耗平台币(兼容字段:付费局=paid_amount,免费局=0)
|
* @property $use_coins 消耗平台币(兼容字段:付费局=paid_amount,免费局=0)
|
||||||
* @property $direction 方向:0=顺时针,1=逆时针
|
* @property $direction 方向:0=顺时针,1=逆时针
|
||||||
* @property $reward_config_id 奖励配置id
|
* @property $reward_tier 中奖档位:T1,T2,T3,T4,T5,BIGWIN
|
||||||
* @property $lottery_id 奖池
|
* @property $lottery_id 奖池
|
||||||
* @property $start_index 起始索引
|
* @property $start_index 起始索引
|
||||||
* @property $target_index 结束索引
|
* @property $target_index 结束索引
|
||||||
@@ -64,15 +64,6 @@ class DicePlayRecord extends BaseModel
|
|||||||
return $this->belongsTo(DicePlayer::class, 'player_id', 'id');
|
return $this->belongsTo(DicePlayer::class, 'player_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 中奖配置
|
|
||||||
* 关联模型 diceRewardConfig
|
|
||||||
*/
|
|
||||||
public function diceRewardConfig(): BelongsTo
|
|
||||||
{
|
|
||||||
return $this->belongsTo(DiceRewardConfig::class, 'reward_config_id', 'id');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 彩金池配置
|
* 彩金池配置
|
||||||
* 关联模型 diceLotteryPoolConfig
|
* 关联模型 diceLotteryPoolConfig
|
||||||
@@ -252,24 +243,19 @@ class DicePlayRecord extends BaseModel
|
|||||||
}
|
}
|
||||||
$ids = DiceRewardConfig::where('ui_text', 'like', '%' . $value . '%')->column('id');
|
$ids = DiceRewardConfig::where('ui_text', 'like', '%' . $value . '%')->column('id');
|
||||||
if (!empty($ids)) {
|
if (!empty($ids)) {
|
||||||
$query->whereIn('reward_config_id', $ids);
|
$query->whereIn('target_index', $ids);
|
||||||
} else {
|
} else {
|
||||||
$query->whereRaw('1=0');
|
$query->whereRaw('1=0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 按奖励档位(diceRewardConfig.tier,中奖名 T1-T5) */
|
/** 按奖励档位(表字段 reward_tier,中奖名 T1-T5/BIGWIN) */
|
||||||
public function searchRewardTierAttr($query, $value)
|
public function searchRewardTierAttr($query, $value)
|
||||||
{
|
{
|
||||||
if ($value === '' || $value === null) {
|
if ($value === '' || $value === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$ids = DiceRewardConfig::where('tier', '=', $value)->column('id');
|
$query->where('reward_tier', '=', $value);
|
||||||
if (!empty($ids)) {
|
|
||||||
$query->whereIn('reward_config_id', $ids);
|
|
||||||
} else {
|
|
||||||
$query->whereRaw('1=0');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 方向 0=顺时针 1=逆时针 */
|
/** 方向 0=顺时针 1=逆时针 */
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
namespace app\dice\model\play_record_test;
|
namespace app\dice\model\play_record_test;
|
||||||
|
|
||||||
use plugin\saiadmin\basic\think\BaseModel;
|
use plugin\saiadmin\basic\think\BaseModel;
|
||||||
use app\dice\model\reward_config\DiceRewardConfig;
|
|
||||||
use app\dice\model\reward_config_record\DiceRewardConfigRecord;
|
use app\dice\model\reward_config_record\DiceRewardConfigRecord;
|
||||||
use app\dice\model\lottery_pool_config\DiceLotteryPoolConfig;
|
use app\dice\model\lottery_pool_config\DiceLotteryPoolConfig;
|
||||||
use think\model\relation\BelongsTo;
|
use think\model\relation\BelongsTo;
|
||||||
@@ -23,9 +22,9 @@ use think\model\relation\BelongsTo;
|
|||||||
* @property $is_win 中大奖:0=无,1=中奖
|
* @property $is_win 中大奖:0=无,1=中奖
|
||||||
* @property $win_coin 赢取平台币
|
* @property $win_coin 赢取平台币
|
||||||
* @property int|null $ante 底注/注数(dice_ante_config.mult)
|
* @property int|null $ante 底注/注数(dice_ante_config.mult)
|
||||||
* @property int|null $paid_amount 付费金额(付费局=ante*100,免费局=0)
|
* @property int|null $paid_amount 付费金额(付费局=ante*1,免费局=0)
|
||||||
* @property $direction 方向:0=顺时针,1=逆时针
|
* @property $direction 方向:0=顺时针,1=逆时针
|
||||||
* @property $reward_config_id 奖励配置id
|
* @property $reward_tier 中奖档位:T1,T2,T3,T4,T5,BIGWIN
|
||||||
* @property $create_time 创建时间
|
* @property $create_time 创建时间
|
||||||
* @property $update_time 修改时间
|
* @property $update_time 修改时间
|
||||||
* @property $start_index 起始索引
|
* @property $start_index 起始索引
|
||||||
@@ -52,6 +51,10 @@ class DicePlayRecordTest extends BaseModel
|
|||||||
*/
|
*/
|
||||||
protected $table = 'dice_play_record_test';
|
protected $table = 'dice_play_record_test';
|
||||||
|
|
||||||
|
protected $createTime = 'create_time';
|
||||||
|
|
||||||
|
protected $updateTime = 'update_time';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 彩金池配置
|
* 彩金池配置
|
||||||
* 关联 lottery_config_id -> DiceLotteryPoolConfig.id
|
* 关联 lottery_config_id -> DiceLotteryPoolConfig.id
|
||||||
@@ -61,15 +64,6 @@ class DicePlayRecordTest extends BaseModel
|
|||||||
return $this->belongsTo(DiceLotteryPoolConfig::class, 'lottery_config_id', 'id');
|
return $this->belongsTo(DiceLotteryPoolConfig::class, 'lottery_config_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 奖励配置(终点格 = target_index 对应 DiceRewardConfig.id,表中为 reward_config_id)
|
|
||||||
* 关联 reward_config_id -> DiceRewardConfig.id
|
|
||||||
*/
|
|
||||||
public function diceRewardConfig(): BelongsTo
|
|
||||||
{
|
|
||||||
return $this->belongsTo(DiceRewardConfig::class, 'reward_config_id', 'id');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联的权重测试记录
|
* 关联的权重测试记录
|
||||||
* reward_config_record_id -> DiceRewardConfigRecord.id
|
* reward_config_record_id -> DiceRewardConfigRecord.id
|
||||||
@@ -119,7 +113,7 @@ class DicePlayRecordTest extends BaseModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 付费金额(付费局=ante*100,免费局=0) */
|
/** 付费金额(付费局=ante*1,免费局=0) */
|
||||||
public function searchPaidAmountAttr($query, $value)
|
public function searchPaidAmountAttr($query, $value)
|
||||||
{
|
{
|
||||||
if ($value !== '' && $value !== null) {
|
if ($value !== '' && $value !== null) {
|
||||||
@@ -135,18 +129,13 @@ class DicePlayRecordTest extends BaseModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 中奖档位(按 reward_config_id 对应 DiceRewardConfig.tier) */
|
/** 中奖档位(按表字段 reward_tier) */
|
||||||
public function searchRewardTierAttr($query, $value)
|
public function searchRewardTierAttr($query, $value)
|
||||||
{
|
{
|
||||||
if ($value === '' || $value === null) {
|
if ($value === '' || $value === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$ids = DiceRewardConfig::where('tier', '=', $value)->column('id');
|
$query->where('reward_tier', '=', $value);
|
||||||
if (!empty($ids)) {
|
|
||||||
$query->whereIn('reward_config_id', $ids);
|
|
||||||
} else {
|
|
||||||
$query->whereRaw('1=0');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 点数和 roll_number(摇取点数和 5-30) */
|
/** 点数和 roll_number(摇取点数和 5-30) */
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ use app\dice\model\lottery_pool_config\DiceLotteryPoolConfig;
|
|||||||
* @property $total_ticket_count 总抽奖次数
|
* @property $total_ticket_count 总抽奖次数
|
||||||
* @property $paid_ticket_count 购买抽奖次数
|
* @property $paid_ticket_count 购买抽奖次数
|
||||||
* @property $free_ticket_count 赠送抽奖次数
|
* @property $free_ticket_count 赠送抽奖次数
|
||||||
|
* @property array|null $free_ticket 免费抽奖券:{"ante":1,"count":1}
|
||||||
* @property $create_time 创建时间
|
* @property $create_time 创建时间
|
||||||
* @property $update_time 更新时间
|
* @property $update_time 更新时间
|
||||||
* @property $delete_time 删除时间
|
* @property $delete_time 删除时间
|
||||||
@@ -54,6 +55,10 @@ class DicePlayer extends BaseModel
|
|||||||
|
|
||||||
protected $updateTime = 'update_time';
|
protected $updateTime = 'update_time';
|
||||||
|
|
||||||
|
protected $json = ['free_ticket'];
|
||||||
|
|
||||||
|
protected $jsonAssoc = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增前:生成唯一 uid,昵称 name 默认使用 uid
|
* 新增前:生成唯一 uid,昵称 name 默认使用 uid
|
||||||
* 用 try-catch 避免表尚未含 uid 时 getAttr/getData 抛 InvalidArgumentException
|
* 用 try-catch 避免表尚未含 uid 时 getAttr/getData 抛 InvalidArgumentException
|
||||||
|
|||||||
@@ -22,22 +22,23 @@ use think\model\relation\HasMany;
|
|||||||
* @property int|null $lottery_config_id 测试时使用的奖池配置 ID(兼容旧:付费+免费共用)
|
* @property int|null $lottery_config_id 测试时使用的奖池配置 ID(兼容旧:付费+免费共用)
|
||||||
* @property int|null $paid_lottery_config_id 付费抽奖奖池配置 ID,默认 type=0
|
* @property int|null $paid_lottery_config_id 付费抽奖奖池配置 ID,默认 type=0
|
||||||
* @property int|null $free_lottery_config_id 免费抽奖奖池配置 ID,默认 type=1
|
* @property int|null $free_lottery_config_id 免费抽奖奖池配置 ID,默认 type=1
|
||||||
* @property int $total_play_count 总模拟次数(s_count+n_count)
|
* @property int $total_play_count 总模拟次数
|
||||||
* @property int $over_play_count 已完成次数
|
* @property int $over_play_count 已完成次数
|
||||||
* @property int $status 状态 -1失败 0进行中 1成功
|
* @property int $status 状态 -1失败 0进行中 1成功
|
||||||
* @property string|null $remark 失败时记录原因
|
* @property string|null $remark 失败时记录原因
|
||||||
* @property int|null $ante 底注/注数(dice_ante_config.mult)
|
* @property int|null $ante 底注/注数(dice_ante_config.mult)
|
||||||
* @property int $s_count 顺时针模拟次数(兼容旧数据)
|
|
||||||
* @property int $n_count 逆时针模拟次数(兼容旧数据)
|
|
||||||
* @property int $paid_s_count 付费抽奖顺时针次数
|
* @property int $paid_s_count 付费抽奖顺时针次数
|
||||||
* @property int $paid_n_count 付费抽奖逆时针次数
|
* @property int $paid_n_count 付费抽奖逆时针次数
|
||||||
* @property int $free_s_count 免费抽奖顺时针次数
|
* @property int $chain_free_mode 1=链式再来一次免费抽奖
|
||||||
* @property int $free_n_count 免费抽奖逆时针次数
|
* @property int $kill_mode_enabled 测试内杀分开关 1=开启
|
||||||
|
* @property int $test_safety_line 测试内安全线(模拟玩家累计盈利阈值)
|
||||||
|
* @property int $paid_planned_spins 计划付费抽奖次数(顺+逆)
|
||||||
|
* @property int $play_again_count 再来一次次数(T5触发次数)
|
||||||
* @property array|null $paid_tier_weights 付费自定义档位权重 T1-T5
|
* @property array|null $paid_tier_weights 付费自定义档位权重 T1-T5
|
||||||
* @property array|null $free_tier_weights 免费自定义档位权重 T1-T5
|
* @property array|null $free_tier_weights 免费自定义档位权重 T1-T5
|
||||||
* @property array $result_counts 落点统计 grid_number=>出现次数
|
* @property array $result_counts 落点统计 grid_number=>出现次数
|
||||||
* @property array|null $tier_counts 档位出现次数 T1=>count
|
* @property array|null $tier_counts 档位出现次数 T1=>count
|
||||||
* @property float|null $platform_profit 平台赚取金额(付费抽取次数×100-玩家总收益)
|
* @property float|null $platform_profit 平台赚取金额(付费金额 paid_amount 求和-玩家总收益)
|
||||||
* @property array|null $bigwin_weight 测试时 BIGWIN 档位权重快照(JSON:grid_number=>weight)
|
* @property array|null $bigwin_weight 测试时 BIGWIN 档位权重快照(JSON:grid_number=>weight)
|
||||||
* @property int|null $admin_id 执行测试的管理员ID
|
* @property int|null $admin_id 执行测试的管理员ID
|
||||||
* @property string|null $create_time 创建时间
|
* @property string|null $create_time 创建时间
|
||||||
@@ -69,6 +70,22 @@ class DiceRewardConfigRecord extends BaseModel
|
|||||||
return $this->hasMany(DicePlayRecordTest::class, 'reward_config_record_id', 'id');
|
return $this->hasMany(DicePlayRecordTest::class, 'reward_config_record_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 计划付费抽奖次数(顺+逆) */
|
||||||
|
public function searchPaidPlannedSpinsAttr($query, $value): void
|
||||||
|
{
|
||||||
|
if ($value !== '' && $value !== null) {
|
||||||
|
$query->where('paid_planned_spins', '=', $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 底注/注数(dice_ante_config.mult) */
|
||||||
|
public function searchAnteAttr($query, $value): void
|
||||||
|
{
|
||||||
|
if ($value !== '' && $value !== null) {
|
||||||
|
$query->where('ante', '=', $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据关联的 DicePlayRecordTest 统计平台赚取平台币
|
* 根据关联的 DicePlayRecordTest 统计平台赚取平台币
|
||||||
* platform_profit = 关联的付费(lottery_type=0)付费金额求和(paid_amount) - 关联的 win_coin 求和
|
* platform_profit = 关联的付费(lottery_type=0)付费金额求和(paid_amount) - 关联的 win_coin 求和
|
||||||
@@ -85,6 +102,18 @@ class DiceRewardConfigRecord extends BaseModel
|
|||||||
return round($paidAmount - $sumWinCoin, 2);
|
return round($paidAmount - $sumWinCoin, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据关联的 DicePlayRecordTest 统计再来一次次数(reward_tier=T5)
|
||||||
|
* @param int $recordId
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public static function computePlayAgainCountFromRelated(int $recordId): int
|
||||||
|
{
|
||||||
|
return (int) DicePlayRecordTest::where('reward_config_record_id', $recordId)
|
||||||
|
->where('reward_tier', 'T5')
|
||||||
|
->count();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据关联的 DicePlayRecordTest 统计落点次数
|
* 根据关联的 DicePlayRecordTest 统计落点次数
|
||||||
* result_counts = [grid_number => 出现次数],只统计 roll_number 在 5-30 之间的记录
|
* result_counts = [grid_number => 出现次数],只统计 roll_number 在 5-30 之间的记录
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class DicePlayRecordValidate extends BaseValidate
|
|||||||
'lottery_type' => 'require',
|
'lottery_type' => 'require',
|
||||||
'is_win' => 'require',
|
'is_win' => 'require',
|
||||||
'win_coin' => 'require',
|
'win_coin' => 'require',
|
||||||
'reward_config_id' => 'require',
|
'reward_tier' => 'require',
|
||||||
'roll_array' => 'require|checkRollArray',
|
'roll_array' => 'require|checkRollArray',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ class DicePlayRecordValidate extends BaseValidate
|
|||||||
'lottery_type' => '抽奖类型必须填写',
|
'lottery_type' => '抽奖类型必须填写',
|
||||||
'is_win' => '中奖必须填写',
|
'is_win' => '中奖必须填写',
|
||||||
'win_coin' => '赢取平台币必须填写',
|
'win_coin' => '赢取平台币必须填写',
|
||||||
'reward_config_id' => '奖励配置必须填写',
|
'reward_tier' => '中奖档位必须填写',
|
||||||
'roll_array.require' => '摇取点数必须填写',
|
'roll_array.require' => '摇取点数必须填写',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ class DicePlayRecordValidate extends BaseValidate
|
|||||||
'lottery_type',
|
'lottery_type',
|
||||||
'is_win',
|
'is_win',
|
||||||
'win_coin',
|
'win_coin',
|
||||||
'reward_config_id',
|
'reward_tier',
|
||||||
'roll_array',
|
'roll_array',
|
||||||
],
|
],
|
||||||
'update' => [
|
'update' => [
|
||||||
@@ -58,7 +58,7 @@ class DicePlayRecordValidate extends BaseValidate
|
|||||||
'lottery_type',
|
'lottery_type',
|
||||||
'is_win',
|
'is_win',
|
||||||
'win_coin',
|
'win_coin',
|
||||||
'reward_config_id',
|
'reward_tier',
|
||||||
'roll_array',
|
'roll_array',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class DicePlayRecordTestValidate extends BaseValidate
|
|||||||
'lottery_type' => 'require',
|
'lottery_type' => 'require',
|
||||||
'is_win' => 'require',
|
'is_win' => 'require',
|
||||||
'direction' => 'require',
|
'direction' => 'require',
|
||||||
'reward_config_id' => 'require',
|
'reward_tier' => 'require',
|
||||||
'status' => 'require',
|
'status' => 'require',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ class DicePlayRecordTestValidate extends BaseValidate
|
|||||||
'lottery_type' => '抽奖类型:0=付费,1=免费必须填写',
|
'lottery_type' => '抽奖类型:0=付费,1=免费必须填写',
|
||||||
'is_win' => '中大奖:0=无,1=中奖必须填写',
|
'is_win' => '中大奖:0=无,1=中奖必须填写',
|
||||||
'direction' => '方向:0=顺时针,1=逆时针必须填写',
|
'direction' => '方向:0=顺时针,1=逆时针必须填写',
|
||||||
'reward_config_id' => '奖励配置id必须填写',
|
'reward_tier' => '中奖档位必须填写',
|
||||||
'status' => '状态:0=失败,1=成功必须填写',
|
'status' => '状态:0=失败,1=成功必须填写',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ class DicePlayRecordTestValidate extends BaseValidate
|
|||||||
'lottery_type',
|
'lottery_type',
|
||||||
'is_win',
|
'is_win',
|
||||||
'direction',
|
'direction',
|
||||||
'reward_config_id',
|
'reward_tier',
|
||||||
'status',
|
'status',
|
||||||
],
|
],
|
||||||
'update' => [
|
'update' => [
|
||||||
@@ -54,7 +54,7 @@ class DicePlayRecordTestValidate extends BaseValidate
|
|||||||
'lottery_type',
|
'lottery_type',
|
||||||
'is_win',
|
'is_win',
|
||||||
'direction',
|
'direction',
|
||||||
'reward_config_id',
|
'reward_tier',
|
||||||
'status',
|
'status',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
15
server/app/view/404.html
Normal file
15
server/app/view/404.html
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title><?= $message ?></title>
|
||||||
|
<style>
|
||||||
|
body { font-family: system-ui, sans-serif; text-align: center; margin-top: 4rem; color: #333; }
|
||||||
|
h1 { font-size: 1.5rem; font-weight: 600; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1><?= $message ?></h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -46,10 +46,13 @@ Route::group('/api', function () {
|
|||||||
Route::any('/user/walletRecord', [app\api\controller\UserController::class, 'walletRecord']);
|
Route::any('/user/walletRecord', [app\api\controller\UserController::class, 'walletRecord']);
|
||||||
Route::any('/user/playGameRecord', [app\api\controller\UserController::class, 'playGameRecord']);
|
Route::any('/user/playGameRecord', [app\api\controller\UserController::class, 'playGameRecord']);
|
||||||
Route::any('/game/config', [app\api\controller\GameController::class, 'config']);
|
Route::any('/game/config', [app\api\controller\GameController::class, 'config']);
|
||||||
Route::any('/game/buyLotteryTickets', [app\api\controller\GameController::class, 'buyLotteryTickets']);
|
// Route::any('/game/buyLotteryTickets', [app\api\controller\GameController::class, 'buyLotteryTickets']);
|
||||||
Route::any('/game/lotteryPool', [app\api\controller\GameController::class, 'lotteryPool']);
|
Route::any('/game/lotteryPool', [app\api\controller\GameController::class, 'lotteryPool']);
|
||||||
Route::any('/game/anteConfig', [app\api\controller\GameController::class, 'anteConfig']);
|
Route::any('/game/anteConfig', [app\api\controller\GameController::class, 'anteConfig']);
|
||||||
Route::any('/game/playStart', [app\api\controller\GameController::class, 'playStart']);
|
Route::any('/game/playStart', [app\api\controller\GameController::class, 'playStart']);
|
||||||
})->middleware([
|
})->middleware([
|
||||||
TokenMiddleware::class,
|
TokenMiddleware::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// 关闭主应用默认路由(/controller/action 隐式映射),未在本文件显式注册的路径返回 404
|
||||||
|
Route::disableDefaultRoute('');
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- DicePlayRecord 新增注数与付费金额字段
|
-- DicePlayRecord 新增注数与付费金额字段
|
||||||
ALTER TABLE `dice_play_record`
|
ALTER TABLE `dice_play_record`
|
||||||
ADD COLUMN `ante` int unsigned NOT NULL DEFAULT 1 COMMENT '底注/注数(必须为 dice_ante_config.mult 中存在的值)' AFTER `lottery_type`,
|
ADD COLUMN `ante` int unsigned NOT NULL DEFAULT 1 COMMENT '底注/注数(必须为 dice_ante_config.mult 中存在的值)' AFTER `lottery_type`,
|
||||||
ADD COLUMN `paid_amount` int unsigned NOT NULL DEFAULT 0 COMMENT '付费金额(付费局=ante*100,免费局=0)' AFTER `ante`;
|
ADD COLUMN `paid_amount` int unsigned NOT NULL DEFAULT 0 COMMENT '付费金额(付费局=ante*1,免费局=0)' AFTER `ante`;
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ Route::group('/core', function () {
|
|||||||
fastRoute('dice/play_record/DicePlayRecord', \app\dice\controller\play_record\DicePlayRecordController::class);
|
fastRoute('dice/play_record/DicePlayRecord', \app\dice\controller\play_record\DicePlayRecordController::class);
|
||||||
Route::get('/dice/play_record/DicePlayRecord/getPlayerOptions', [\app\dice\controller\play_record\DicePlayRecordController::class, 'getPlayerOptions']);
|
Route::get('/dice/play_record/DicePlayRecord/getPlayerOptions', [\app\dice\controller\play_record\DicePlayRecordController::class, 'getPlayerOptions']);
|
||||||
Route::get('/dice/play_record/DicePlayRecord/getLotteryConfigOptions', [\app\dice\controller\play_record\DicePlayRecordController::class, 'getLotteryConfigOptions']);
|
Route::get('/dice/play_record/DicePlayRecord/getLotteryConfigOptions', [\app\dice\controller\play_record\DicePlayRecordController::class, 'getLotteryConfigOptions']);
|
||||||
Route::get('/dice/play_record/DicePlayRecord/getRewardConfigOptions', [\app\dice\controller\play_record\DicePlayRecordController::class, 'getRewardConfigOptions']);
|
|
||||||
fastRoute('dice/player_wallet_record/DicePlayerWalletRecord', \app\dice\controller\player_wallet_record\DicePlayerWalletRecordController::class);
|
fastRoute('dice/player_wallet_record/DicePlayerWalletRecord', \app\dice\controller\player_wallet_record\DicePlayerWalletRecordController::class);
|
||||||
Route::get('/dice/player_wallet_record/DicePlayerWalletRecord/getPlayerOptions', [\app\dice\controller\player_wallet_record\DicePlayerWalletRecordController::class, 'getPlayerOptions']);
|
Route::get('/dice/player_wallet_record/DicePlayerWalletRecord/getPlayerOptions', [\app\dice\controller\player_wallet_record\DicePlayerWalletRecordController::class, 'getPlayerOptions']);
|
||||||
Route::get('/dice/player_wallet_record/DicePlayerWalletRecord/getPlayerWalletBefore', [\app\dice\controller\player_wallet_record\DicePlayerWalletRecordController::class, 'getPlayerWalletBefore']);
|
Route::get('/dice/player_wallet_record/DicePlayerWalletRecord/getPlayerWalletBefore', [\app\dice\controller\player_wallet_record\DicePlayerWalletRecordController::class, 'getPlayerWalletBefore']);
|
||||||
|
|||||||
@@ -12,3 +12,5 @@ Route::group('/tool/install', function () {
|
|||||||
Route::get('/online/storeAppVersions', [plugin\saipackage\app\controller\InstallController::class, 'storeAppVersions']);
|
Route::get('/online/storeAppVersions', [plugin\saipackage\app\controller\InstallController::class, 'storeAppVersions']);
|
||||||
Route::post('/online/storeDownloadApp', [plugin\saipackage\app\controller\InstallController::class, 'storeDownloadApp']);
|
Route::post('/online/storeDownloadApp', [plugin\saipackage\app\controller\InstallController::class, 'storeDownloadApp']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::disableDefaultRoute('saipackage');
|
||||||
|
|||||||
146
项目文档.md
146
项目文档.md
@@ -1,146 +0,0 @@
|
|||||||
# 大富翁 · 摇色子 — 项目文档
|
|
||||||
|
|
||||||
本文描述**业务玩法**与**服务端抽奖/结算机制**,便于产品、运营与二次开发对齐实现。接口路径、鉴权与联调细节见根目录 [`API对接文档.md`](API对接文档.md)。
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 1. 项目概述
|
|
||||||
|
|
||||||
- **形态**:平台玩家使用「平台币」参与摇五颗标准六面骰(点数各 1–6),结果对应棋盘/奖励配置;后台可配置档位权重、奖池、杀分策略与展示文案(含中英文)。
|
|
||||||
- **服务端**:PHP [Webman](https://www.workerman.net/webman)(`server/`),玩家与平台接口在 `app/api`;骰子业务模型在 `app/dice`。
|
|
||||||
- **管理端**:前端工程 `saiadmin-artd/`(与 SaiAdmin 插件体系配套)。
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 2. 核心概念
|
|
||||||
|
|
||||||
| 概念 | 说明 |
|
|
||||||
| --- | --- |
|
|
||||||
| **平台币 `coin`** | 玩家钱包余额;付费开局、购买套餐、中奖结算均围绕该字段。 |
|
|
||||||
| **注数 `ante`** | 倍数因子,须存在于表 `dice_ante_config` 的 `mult` 中;接口 `/api/game/anteConfig` 返回可选注数。 |
|
|
||||||
| **单注费用** | 付费抽奖时,开局前扣除 **`ante × 100`** 平台币(代码常量 `UNIT_COST = 100`,即「单注 100 币」口径)。 |
|
|
||||||
| **方向 `direction`** | 开局参数:`0` 与 `1` 对应两套奖励数据(顺时针/逆时针或「无 / 中奖」分支,由前端与配置表共同约定);服务端在 **档位确定后**,按当前方向从 `DiceReward` 缓存结构中取该档位下的条目再按权重抽取。 |
|
|
||||||
| **档位 T1–T5** | 中奖层级;先抽档位,再在该档位 + 当前方向下按 `weight` 抽一条奖励配置。 |
|
|
||||||
| **`grid_number`(5–30)** | 与「五颗骰子点数之和」一致:最小 5(全 1),最大 30(全 6);用于关联奖励行与后续生成 `roll_array`。 |
|
|
||||||
| **`real_ev`** | 奖励配置中的期望调节项;**普通中奖**结算为 **`(100 + real_ev) × ante`**(付费局在开局已扣 `ante×100`,净效果依 `real_ev` 而定)。 |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 3. 玩法流程(玩家视角)
|
|
||||||
|
|
||||||
1. **登录 / 进游戏**
|
|
||||||
平台侧通过 `/api/v1/getGameUrl` 或玩家侧 `/api/user/Login` 换取 token,打开前端页面。
|
|
||||||
|
|
||||||
2. **(可选)购买「抽奖券」套餐**
|
|
||||||
`POST /api/game/buyLotteryTickets`,`count` 仅支持 `1`、`5`、`10`:
|
|
||||||
- 1:100 币 → 1 次付费计数 + 0 次赠送
|
|
||||||
- 5:500 币 → 5 次付费 + **1 次赠送**(共 6 次计入总次数)
|
|
||||||
- 10:1000 币 → 10 次付费 + **3 次赠送**(共 13 次)
|
|
||||||
|
|
||||||
会更新玩家身上的 `total_ticket_count` / `paid_ticket_count` / `free_ticket_count`,并记钱包与券流水。
|
|
||||||
|
|
||||||
3. **开局抽奖**
|
|
||||||
`POST /api/game/playStart`,需传 **`direction`(0 或 1)** 与 **`ante`(正整数,且须在底注配置中)**。
|
|
||||||
|
|
||||||
4. **付费 vs 免费**
|
|
||||||
- **免费抽奖**:当 `free_ticket_count > 0` 时,本局视为免费类型:不扣 `ante×100`,但会消耗 **1 次** `free_ticket_count`。
|
|
||||||
- **付费抽奖**:不依赖「券张数是否大于 0」;只要非免费局,开局前扣 **`ante × 100`**。
|
|
||||||
|
|
||||||
> **重要**:当前实现已**不再用「抽奖券张数」作为能否开局的条件**;`buyLotteryTickets` 更新的是统计与赠送次数,**真正开局仍看余额、注数、免费次数等规则**(见下节)。
|
|
||||||
|
|
||||||
5. **免费注数锁定**
|
|
||||||
若上一局因命中 **T5** 赠送了免费次数,服务端会缓存「免费局须与触发时相同的 `ante`」,不一致则拒绝并提示修改注数。
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 4. 抽奖与结算机制(服务端逻辑)
|
|
||||||
|
|
||||||
以下对应 `PlayStartLogic` 与 `LotteryService`,便于理解「先抽什么、再算什么钱」。
|
|
||||||
|
|
||||||
### 4.1 前置校验
|
|
||||||
|
|
||||||
- 用户存在;`ante` 合法。
|
|
||||||
- **最低余额**:`coin ≥ abs(min_real_ev) × ante`(`min_real_ev` 来自全表 `DiceRewardConfig` 缓存),防止极端负 EV 下余额不足以覆盖风险口径。
|
|
||||||
- 付费局:`coin ≥ ante × 100`。
|
|
||||||
|
|
||||||
### 4.2 使用哪套「档位权重」:默认奖池 vs 杀分奖池
|
|
||||||
|
|
||||||
配置表 `dice_lottery_pool_config` 至少要有 **`name = default`**;可选 **`name = killScore`**。
|
|
||||||
|
|
||||||
- **`default` 彩金池**维护累计盈利字段 **`profit_amount`**(见 4.5)。
|
|
||||||
- 记:`safety_line` = 安全线,`kill_enabled` = 是否开启杀分。
|
|
||||||
|
|
||||||
**是否按「奖池档位权重」抽档位(`usePoolWeights`)**:
|
|
||||||
|
|
||||||
| 情形 | 档位权重来源 |
|
|
||||||
| --- | --- |
|
|
||||||
| **免费局** | 使用 **killScore** 奖池的 T1–T5 权重;若无 `killScore` 则退回 `default`。 |
|
|
||||||
| **付费局** 且 **杀分开启** 且 **`profit_amount ≥ safety_line`** 且 **存在 killScore** | 使用 **killScore** 的档位权重(杀分模式)。 |
|
|
||||||
| **其他付费局** | 使用 **玩家**身上的 `t1_weight`~`t5_weight`(`DicePlayer` 字段,与 `LotteryService::drawTierByPlayerWeights` 一致)。 |
|
|
||||||
|
|
||||||
档位抽出 **T1–T5** 后,从 `DiceReward` 缓存中取出 **`[该档位][direction]`** 下的所有奖励行,再按行 **`weight`** 做加权随机(仅 `weight > 0` 参与;全为 0 会重试档位,最多约 10 次)。
|
|
||||||
|
|
||||||
### 4.3 杀分模式下的特殊处理
|
|
||||||
|
|
||||||
当使用 **killScore / 免费局** 等与杀分一致的权重路径时:
|
|
||||||
|
|
||||||
- 在奖励抽取阶段会 **排除 `grid_number` 为 5 和 30 的配置**(这两点数和只能对应「全 1」「全 6」豹子,无法做成非豹子展示)。
|
|
||||||
- **不会触发豹子大奖**(见 4.4):若摇到豹子点数组,只生成 **非豹子** 的五骰组合,不发放豹子附加奖金。
|
|
||||||
|
|
||||||
### 4.4 普通奖与「豹子 / BIGWIN」
|
|
||||||
|
|
||||||
- 若本次抽中的 `grid_number` **不是**「豹子集合」`{5,10,15,20,25,30}`:按点数和生成 5 个 1–6 的骰子(和为 `grid_number`),**普通奖金** = **`(100 + real_ev) × ante`**(付费局已预先扣除 `ante×100`)。
|
|
||||||
|
|
||||||
- 若点数和落在豹子集合:
|
|
||||||
- **`grid_number` 为 5 或 30**:若**非**杀分路径,**必定**按豹子结算(五颗相同点数)。
|
|
||||||
- **10 / 15 / 20 / 25**:读取 `DiceRewardConfig` 中 **`tier = BIGWIN`** 且对应该 `grid_number` 的配置,用其 **`weight`(0–10000,10000=100%)** 随机决定是否视为真豹子;否则生成**非豹子**但点数和不变的骰子组合。
|
|
||||||
- **真豹子**时:奖金按 **`(100 + big_win_real_ev) × ante`** 发放(`big_win_real_ev` 来自 BIGWIN 配置;若未配则用代码兜底常量);并**不计入**当次普通 `reward_win` 那条配置(与「中豹子不走普通奖」逻辑一致,详见代码注释)。
|
|
||||||
|
|
||||||
杀分路径下:**不触发**豹子奖,仅展示非豹子组合。
|
|
||||||
|
|
||||||
### 4.5 T5「再来一次」
|
|
||||||
|
|
||||||
若命中奖励属于 **T5** 档位(且未走「仅豹子清掉普通奖」的特殊分支):在事务内为玩家 **`free_ticket_count + 1`**,并写入券流水备注;同时写入 Redis:**下一局免费抽奖必须使用本局相同 `ante`**。
|
|
||||||
|
|
||||||
### 4.6 彩金池盈利累计
|
|
||||||
|
|
||||||
在 **`default`** 那条池子上更新 **`profit_amount`**:
|
|
||||||
|
|
||||||
- **付费局**:本局贡献 `+= (本局总中奖 win_coin) - (本局付费 paid_amount)`,其中 `paid_amount = ante × 100`。
|
|
||||||
- **免费局**:`+= win_coin`(无票价成本,`paid_amount = 0`)。
|
|
||||||
|
|
||||||
该累计值与 **`safety_line`、 `kill_enabled`** 共同决定下一局付费是否进入 **killScore** 档位权重(见 4.2)。
|
|
||||||
|
|
||||||
> 注意:仓库中部分数据库迁移脚本对 `profit_amount` 的注释可能仍沿用旧口径(例如按 `100-real_ev` 解释)。当前线上行为应以 `PlayStartLogic` 中对 `profit_amount` 的实际累加逻辑为准。
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 5. 数据与配置要点(实现侧)
|
|
||||||
|
|
||||||
- **`DiceReward`**:按档位、方向组织好的多语言/展示与 `grid_number`、`weight`、`real_ev` 等,供开局加权抽取。
|
|
||||||
- **`DiceRewardConfig`**:含 **BIGWIN** 档及普通档;`getCachedMinRealEv()` 等用于全局限定。
|
|
||||||
- **`dice_lottery_pool_config`**:`default` / `killScore` 的 T1–T5 权重及杀分相关开关、安全线、累计盈利。
|
|
||||||
- **对局表 `DicePlayRecord`**:记录 `lottery_config_id`、`lottery_type`(付费/免费)、`ante`、`paid_amount`、`roll_array`、`reward_config_id`、各类中奖拆分字段等,供后台与平台对账。
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 6. 接口与文档索引
|
|
||||||
|
|
||||||
| 文档 | 内容 |
|
|
||||||
| --- | --- |
|
|
||||||
| [`API对接文档.md`](API对接文档.md) | 平台 `/api/v1/*`(`auth-token`)、玩家 `/api/*`(`token`)、统一返回码、联调建议。 |
|
|
||||||
| `server/docs/` | 性能、权重测试、出点分析等专项说明(按需阅读)。 |
|
|
||||||
|
|
||||||
**与玩法直接相关的玩家接口示例**:
|
|
||||||
|
|
||||||
- `GET /api/game/config` — 前端文案与分组配置
|
|
||||||
- `GET /api/game/anteConfig` — 可选注数
|
|
||||||
- `GET /api/game/lotteryPool` — 彩金池展示列表(不含 BIGWIN 档)
|
|
||||||
- `POST /api/game/buyLotteryTickets` — 购买套餐(更新次数统计)
|
|
||||||
- `POST /api/game/playStart` — 开局一局(`direction`、`ante`)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 7. 修订说明
|
|
||||||
|
|
||||||
- 本文档依据 `server/app/api/logic/PlayStartLogic.php`、`GameLogic.php`、`LotteryService.php` 及 `GameController` 当前实现整理;若业务规则变更,请以代码与数据库迁移为准并同步更新本节与 [`API对接文档.md`](API对接文档.md)。
|
|
||||||
Reference in New Issue
Block a user