|
|
@@ -1,77 +1,77 @@
|
|
|
# 打码量与冻结金额:后台接口
|
|
|
|
|
|
-All endpoints in this doc are served by the bot-28 admin service and use admin authentication. A successful call returns `code=0`. All amounts are strings with 2 decimal places.
|
|
|
+本文档接口均由 bot-28 后台服务提供,使用管理员认证,成功返回 `code=0`。金额字段均为两位小数字符串。
|
|
|
|
|
|
-## Business rules
|
|
|
+## 业务规则
|
|
|
|
|
|
-| Item | Rule |
|
|
|
+| 项目 | 规则 |
|
|
|
|---|---|
|
|
|
-| 打码量 (wagering) | Each user has one current cycle. **Required wagering** is the sum of every requirement: deposit/人工充值 × the platform multiple, the wagering configured on each activity, and wagering entered by admins. **Current wagering** (当前打码量) is the effective bets placed in this cycle. **Remaining wagering** (剩余打码量) is required minus current, floored at 0. |
|
|
|
-| Withdrawal | Withdrawal is blocked while remaining wagering is above 0, so a single unfinished activity requirement is enough to block it. After a successful withdrawal request, the cycle resets: required and current both go back to 0. |
|
|
|
-| Effective bet | Same rule as activity turnover: settled, non-voided bets, counted as min(stake, \|profit/loss\|). The cache refreshes every minute. |
|
|
|
-| Platform multiple | Config field `withdraw_wager_multiple` (提现打码倍数), default `1`. Edit it in the existing system config list. |
|
|
|
-| Activity rewards | All rewards go straight into **available balance** and no longer use frozen balance. Rewards with a configured wagering requirement add it; rewards without one can be withdrawn immediately and do not use the platform multiple. |
|
|
|
-| Withdrawal freeze | On a withdrawal request, available balance moves into frozen balance. If the request is rejected or fails, the money returns to available balance. If it succeeds, the money is deducted from frozen balance. |
|
|
|
+| 打码量 | 每个会员有一个当前打码周期。**所需打码量**为各项要求之和:充值/人工充值 × 平台倍数、各活动配置的打码量、后台填写的打码量。**当前打码量**为本周期的有效投注。**剩余打码量** = 所需 − 当前,最低为 0。 |
|
|
|
+| 提现 | 剩余打码量大于 0 时不能提现,只要有一项活动打码未完成就会拦截。提现申请成功后重置周期:所需与当前打码量都归 0。 |
|
|
|
+| 有效投注 | 与活动流水同一口径:已结算、未作废的注单,按 min(本金, \|输赢\|) 计算。缓存每分钟刷新一次。 |
|
|
|
+| 平台倍数 | 配置项 `withdraw_wager_multiple`(提现打码倍数),默认 `1`,在现有系统配置列表中修改。 |
|
|
|
+| 活动赠送 | 所有赠送直接进入**可用余额**,不再走冻结金额。配置了打码量的累加打码量;未配置的可直接提现,也不走平台倍数。 |
|
|
|
+| 提现冻结 | 申请提现时,可用余额转入冻结余额。审核拒绝或失败退回可用余额;成功则从冻结余额扣除。 |
|
|
|
|
|
|
-## 1. 会员列表 new fields
|
|
|
+## 1. 会员列表新增字段
|
|
|
|
|
|
-`GET /admin/user` (existing endpoint). Each `data.data[]` row gains:
|
|
|
+`GET /admin/user`(现有接口),`data.data[]` 每行新增:
|
|
|
|
|
|
-| Field | Meaning |
|
|
|
+| 字段 | 含义 |
|
|
|
|---|---|
|
|
|
-| `wager_required` | Required wagering in the current cycle |
|
|
|
-| `wager_completed` | 当前打码量 (current wagering) |
|
|
|
-| `wager_remaining` | 剩余打码量 (remaining wagering); the user can withdraw when this is 0 |
|
|
|
-| `total_consume` | Unchanged: lifetime bet volume (the old 打码量 column) |
|
|
|
-| `wallet.frozen_balance` | Frozen balance: manual freezes plus withdrawals under review |
|
|
|
+| `wager_required` | 本周期所需打码量 |
|
|
|
+| `wager_completed` | 当前打码量 |
|
|
|
+| `wager_remaining` | 剩余打码量,为 0 时可以提现 |
|
|
|
+| `total_consume` | 不变:历史总投注额(原“打码量”列) |
|
|
|
+| `wallet.frozen_balance` | 冻结余额:人工冻结 + 审核中的提现 |
|
|
|
|
|
|
-Each `data.data[]` row in the 人工稽查 list `GET /admin/manualAudit` gains a `member_wager` object with the same three fields, plus `wager_amount`, the signed wagering change made by that operation.
|
|
|
+人工稽查列表 `GET /admin/manualAudit` 的 `data.data[]` 每行新增 `member_wager` 对象(同上三个字段),以及 `wager_amount`:该次操作的打码量变动(有符号)。
|
|
|
|
|
|
-## 2. 上下分: wagering params
|
|
|
+## 2. 上下分:打码量参数
|
|
|
|
|
|
### 人工稽查
|
|
|
|
|
|
-`POST /admin/manualAudit/topUp`, adding to the existing params:
|
|
|
+`POST /admin/manualAudit/topUp`,在现有参数基础上新增:
|
|
|
|
|
|
-| Param | Required | Notes |
|
|
|
+| 参数 | 必填 | 说明 |
|
|
|
|---|---|---|
|
|
|
-| `wager_amount` | No | Only used when `change_type` is not `人工充值`. Wagering to add, ≥0; empty means 0 (withdrawable immediately). With `人工充值`, the system adds amount × platform multiple and ignores this param. |
|
|
|
+| `wager_amount` | 否 | 仅 `change_type` 不是 `人工充值` 时生效:要增加的打码量,≥0,留空为 0(可直接提现)。`人工充值` 由系统按 金额 × 平台倍数 自动增加,忽略此参数。 |
|
|
|
|
|
|
-`POST /admin/manualAudit/debit`, adding to the existing params:
|
|
|
+`POST /admin/manualAudit/debit`,在现有参数基础上新增:
|
|
|
|
|
|
-| Param | Required | Notes |
|
|
|
+| 参数 | 必填 | 说明 |
|
|
|
|---|---|---|
|
|
|
-| `recharge_type` | No | Credit type this debit corresponds to: `人工充值` / `注册赠送` / `优惠活动`. Omit it to leave wagering unchanged. |
|
|
|
-| `wager_amount` | No | Used only when `recharge_type` is not `人工充值`: the wagering to deduct, ≥0. With `人工充值`, the system deducts amount × platform multiple. |
|
|
|
+| `recharge_type` | 否 | 本次下分对应的充值类型:`人工充值` / `注册赠送` / `优惠活动`。不传则不调整打码量。 |
|
|
|
+| `wager_amount` | 否 | 仅 `recharge_type` 不是 `人工充值` 时生效:要扣除的打码量,≥0。`人工充值` 由系统按 金额 × 平台倍数 扣除。 |
|
|
|
|
|
|
-The list endpoint `options` gains `platform_wager_type` (`人工充值`) and `withdraw_wager_multiple` (the current multiple), so the form can preview the result. The balance log for a debit still uses change type `人工扣款`.
|
|
|
+列表接口的 `options` 新增 `platform_wager_type`(`人工充值`)和 `withdraw_wager_multiple`(当前倍数),表单可据此预览。下分的资金日志类型仍为 `人工扣款`。
|
|
|
|
|
|
-### Member list: legacy 上下分
|
|
|
+### 会员列表(旧版上下分)
|
|
|
|
|
|
-`POST /admin/wallet/topUp` takes `wager_amount`, and `POST /admin/wallet/debiting` takes `recharge_type` and `wager_amount`. Both follow the same rules as above.
|
|
|
+`POST /admin/wallet/topUp` 支持 `wager_amount`,`POST /admin/wallet/debiting` 支持 `recharge_type` 和 `wager_amount`,规则同上。
|
|
|
|
|
|
-## 3. Freeze / unfreeze
|
|
|
+## 3. 冻结 / 解冻
|
|
|
|
|
|
-Same params and response for both. The member list and 人工稽查 each have their own permission URI:
|
|
|
+两个操作参数与返回相同,会员列表和人工稽查各有独立的权限 URI:
|
|
|
|
|
|
-| Action | Member list | 人工稽查 |
|
|
|
+| 操作 | 会员列表 | 人工稽查 |
|
|
|
|---|---|---|
|
|
|
-| Freeze | `POST /admin/user/freeze` | `POST /admin/manualAudit/freeze` |
|
|
|
-| Unfreeze | `POST /admin/user/unfreeze` | `POST /admin/manualAudit/unfreeze` |
|
|
|
+| 冻结 | `POST /admin/user/freeze` | `POST /admin/manualAudit/freeze` |
|
|
|
+| 解冻 | `POST /admin/user/unfreeze` | `POST /admin/manualAudit/unfreeze` |
|
|
|
|
|
|
-| Param | Required | Notes |
|
|
|
+| 参数 | 必填 | 说明 |
|
|
|
|---|---|---|
|
|
|
-| `request_id` | Yes | UUID generated by the front end per submission. Resubmitting the same ID returns the original result; submitting it with different content is rejected. |
|
|
|
-| `member_id` / `account` | One of the two | Same as 人工稽查 |
|
|
|
-| `amount` | Yes | Amount, ≥0.01 |
|
|
|
-| `wager_amount` | Yes | Wagering, ≥0. Freezing **reduces** wagering by this amount; unfreezing **increases** it. |
|
|
|
-| `reason` | Yes | Reason, at most 255 characters |
|
|
|
+| `request_id` | 是 | 前端每次提交生成的 UUID。同一 ID 重复提交返回原结果;内容不同则拒绝。 |
|
|
|
+| `member_id` / `account` | 二选一 | 同人工稽查 |
|
|
|
+| `amount` | 是 | 金额,≥0.01 |
|
|
|
+| `wager_amount` | 是 | 打码量,≥0。冻结时**减少**该打码量,解冻时**增加**该打码量。 |
|
|
|
+| `reason` | 是 | 原因,最多 255 字 |
|
|
|
|
|
|
-- Freeze: moves available balance into frozen balance. Fails if available balance is too low.
|
|
|
-- Unfreeze: moves frozen balance back to available balance. The cap is the user's **outstanding manual freeze amount**; money frozen for a withdrawal under review cannot be unfrozen manually. When over the cap, the error says `可解冻金额不足,最多可解冻:X`.
|
|
|
-- Each operation writes a balance log of type `人工冻结` (−amount) or `人工解冻` (+amount).
|
|
|
+- 冻结:可用余额转入冻结余额,可用余额不足则失败。
|
|
|
+- 解冻:冻结余额退回可用余额。上限为该会员**尚未解冻的人工冻结金额**,审核中提现冻结的资金不能人工解冻。超出时提示 `可解冻金额不足,最多可解冻:X`。
|
|
|
+- 每次操作写一条资金日志:`人工冻结`(−金额)或 `人工解冻`(+金额)。
|
|
|
|
|
|
-Response `data` (a single freeze record; same fields as the list below):
|
|
|
+返回 `data`(单条冻结记录,字段同下方列表):
|
|
|
|
|
|
```json
|
|
|
{ "id": 12, "member_id": "6001", "account": "tg123", "type": "manual_freeze", "type_text": "人工冻结",
|
|
|
@@ -81,26 +81,26 @@ Response `data` (a single freeze record; same fields as the list below):
|
|
|
"finished_at": null, "created_at": "2026-11-04 15:00:00" }
|
|
|
```
|
|
|
|
|
|
-## 4. Freeze record list
|
|
|
+## 4. 冻结记录列表
|
|
|
|
|
|
`GET /admin/walletFreeze`
|
|
|
|
|
|
-| Param | Notes |
|
|
|
+| 参数 | 说明 |
|
|
|
|---|---|
|
|
|
-| `page`, `limit` | `limit` ≤200, default 20 |
|
|
|
-| `member_id`, `account` | Filter by member |
|
|
|
+| `page`、`limit` | `limit` ≤200,默认 20 |
|
|
|
+| `member_id`、`account` | 按会员筛选 |
|
|
|
| `type` | `manual_freeze` 人工冻结 / `manual_unfreeze` 人工解冻 / `withdraw_hold` 提现冻结 |
|
|
|
| `status` | `frozen` 已冻结 / `done` 已解冻 / `holding` 提现审核中 / `released` 已退回余额 / `settled` 提现成功已扣除 |
|
|
|
-| `start_date`, `end_date` | Y-m-d, pass both together |
|
|
|
+| `start_date`、`end_date` | Y-m-d,须同时传 |
|
|
|
|
|
|
-Response: `data.total`, `data.data[]` (fields as in section 3), and `data.options.types` / `data.options.statuses` (each item has `label` and `value`). For a withdrawal freeze, `related_type` is `withdraws` (USDT) or `payment_orders` (RMB) and `related_id` is the withdrawal order ID.
|
|
|
+返回:`data.total`、`data.data[]`(字段同第 3 节)、`data.options.types` / `data.options.statuses`(每项含 `label`、`value`)。提现冻结的 `related_type` 为 `withdraws`(USDT)或 `payment_orders`(RMB),`related_id` 为提现单 ID。
|
|
|
|
|
|
-## 5. Permissions and menu
|
|
|
+## 5. 权限与菜单
|
|
|
|
|
|
-The migration adds a 会员管理 → 冻结记录 menu (front-end route key `walletFreeze`) and these buttons:
|
|
|
+迁移新增 会员管理 → 冻结记录 菜单(前端路由 key `walletFreeze`)及以下按钮:
|
|
|
|
|
|
- `admin/walletFreeze`
|
|
|
-- `admin/user/freeze`, `admin/user/unfreeze`
|
|
|
-- `admin/manualAudit/freeze`, `admin/manualAudit/unfreeze`
|
|
|
+- `admin/user/freeze`、`admin/user/unfreeze`
|
|
|
+- `admin/manualAudit/freeze`、`admin/manualAudit/unfreeze`
|
|
|
|
|
|
-After launch, assign these buttons to the roles that need them. Roles that don't have them cannot call these endpoints; the super admin is not restricted.
|
|
|
+上线后请给需要的角色分配这些按钮。未分配的角色无法调用这些接口;超级管理员不受限制。
|