1.修改电话号码格式为60前缀,马来西亚格式
2.优化渠道可以查看分红方式,可以查看游玩详情
This commit is contained in:
88
docs/en/channel-admin-guide.md
Normal file
88
docs/en/channel-admin-guide.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# 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 user’s 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 |
|
||||
@@ -47,11 +47,12 @@ If a sub-agent has further downline, the same rules apply on **their received am
|
||||
|
||||
| Capability | Entry | Notes |
|
||||
|------------|-------|-------|
|
||||
| Channel commission params | `/admin/channel` | `agent_mode`, turnover/affiliate rates, settlement cycle, etc. |
|
||||
| Channel commission params | `/admin/channel` | `agent_mode`, turnover/affiliate rates, etc.; see [channel-admin-guide.md](./channel-admin-guide.md) |
|
||||
| Agent tree & share rates | `/admin/auth/admin` | Tree list; parent agent, share rate, channel |
|
||||
| Channel filter | Admin list common search | Super admin can filter by channel |
|
||||
| Channel list read scope | `/admin/channel` | Super admin / unbound groups / `viewAllChannels` → all channels read-only |
|
||||
| Visibility | Admin list | Non–super admin sees **self + all downline** only |
|
||||
| Settlement | `/admin/channel` manual / cron | **Super admin only**; credits `admin_wallet` on settle |
|
||||
| Settlement | `/admin/channel` manual / cron | Super admin **or** `channel/manualSettle`; batch still super admin only |
|
||||
|
||||
### 3.1 Share rate validation
|
||||
|
||||
@@ -80,7 +81,7 @@ If a level totals 100%, the parent at that level keeps **no commission**.
|
||||
|
||||
## 4. Settlement Flow
|
||||
|
||||
1. Super admin triggers channel settlement (manual or `ChannelAutoSettleTicker`)
|
||||
1. Super admin or holder of `channel/manualSettle` triggers settlement (manual or cron; batch API still super admin only)
|
||||
2. `ChannelSettlementService::buildSettlePayload` aggregates bets and computes channel total commission
|
||||
3. `AdminCommissionDistributionService::distributeChannelCommission` splits by agent tree
|
||||
4. In one transaction:
|
||||
@@ -123,6 +124,8 @@ If a level totals 100%, the parent at that level keeps **no commission**.
|
||||
| Module | Path |
|
||||
|--------|------|
|
||||
| Channel settlement | `app/common/service/ChannelSettlementService.php` |
|
||||
| Channel read scope | `app/common/service/AdminChannelScopeService.php` |
|
||||
| Channel admin UI | `app/admin/controller/Channel.php` |
|
||||
| Tree split | `app/common/service/AdminCommissionDistributionService.php` |
|
||||
| Admin CRUD / validation | `app/admin/controller/auth/Admin.php` |
|
||||
| Admin UI | `web/src/views/backend/auth/admin/` |
|
||||
@@ -138,3 +141,4 @@ If a level totals 100%, the parent at that level keeps **no commission**.
|
||||
| 2026-04-23 | Settle-and-pay to admin wallet; `admin_wallet` system |
|
||||
| 2026-05-29 | **Agent tree commission** in Administrator Management; removed channel share UI; tree list & downline visibility |
|
||||
| 2026-05-29 | Top-level role groups (`pid=0`) require channel share rate; parent agent disabled in form |
|
||||
| 2026-05-30 | Channel UI: view-all, bet/dividend dialogs, filters, mobile; manual settle by permission; `channel-admin-guide.md` |
|
||||
|
||||
Reference in New Issue
Block a user