Files
webman-buildadmin/docs/en/channel-admin-guide.md
zhenhui e65c3474bd 1.修改电话号码格式为60前缀,马来西亚格式
2.优化渠道可以查看分红方式,可以查看游玩详情
2026-05-30 11:09:54 +08:00

89 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Channel Management (Admin)
## 1. Purpose
Documents the **Channel Management** page (`/admin/channel`): summary cards, list scope, button permissions, bet-record dialogs, and APIs. For commission calculation and agent tree split, see [commission-share-guide.md](./commission-share-guide.md).
---
## 2. Summary cards
| Card | Description |
|------|-------------|
| Total channels | Count in **readable scope** |
| Enabled | `status = 1` |
| Pending dividend (count) | `carryover_balance > 0` |
| Pending dividend (amount) | Sum of those balances |
| Paid dividend | Sum of paid `agent_commission_record` in scope; clickable dialog requires `viewDividendRecords` |
List filters: **All / With balance / No balance / Enabled only / Disabled only** (UI search only).
---
## 3. Read scope
`AdminChannelScopeService` applies to list and stats:
**Global read** (all channels) if any of:
- Super admin (`*`)
- No `admin_group.channel_id` bound for the users groups
- Button permission `channel/viewAllChannels`
Otherwise: bound group channel IDs, or `admin.channel_id`, or empty.
**Write** (add/edit/delete/manual settle DB) stays on **writable** channels only; `viewAllChannels` does not expand write scope.
---
## 4. Actions & permissions
| Node | Label | Behavior |
|------|-------|----------|
| `channel/viewAllChannels` | View all channels | Global read scope |
| `channel/viewDividendRecords` | Paid dividend records | Top card + dialog |
| `channel/viewDirectBetRecords` | Direct bet records | Direct bet column click |
| `channel/viewSettlementBetRecords` | Settlement-scope bets | Row action |
| `channel/manualSettle` | Manual settle | Preview + submit (readable channel) |
| `channel/batchSettlePending` | Batch settle | **Super admin only** |
Re-login after role changes to refresh `authNode`.
---
## 5. Manual settlement
- `GET /admin/channel/manualSettlePreview?id=`
- `POST /admin/channel/manualSettle`
- Super admin **or** `channel/manualSettle` with channel in read scope
- Same payout flow as super-admin settle (`ChannelSettlementService::settleBySuperAdmin`)
---
## 6. Bet record dialogs
| Entry | API | Data |
|-------|-----|------|
| Direct bet amount | `directBetRecordList` | All play records for channel |
| View settlement bets | `settlementBetRecordList` | `status = 2` only |
**Filters (GET):** `period_no`, `user_keyword`, `result_number`, `pick_number`, `win_hit` (`won`/`lost`/`pending`), `page`, `limit`.
**Columns:** period, player, channel, picks, winning number, win status, bet amount, win amount.
**Mobile:** ~92% width, scrollable body, 3 summary cards per row, horizontal table scroll.
---
## 7. APIs
See §8 in the Chinese doc `docs/渠道管理后台说明.md` (same paths under `/admin/channel/`).
---
## 8. Changelog
| Date | Note |
|------|------|
| 2026-05-30 | Bet record columns, filters, mobile layout; `viewAllChannels`; manual settle by permission |