feat(admin): redesign withdrawal review page and drop dead withdrawal code
- Split PayWithdrawals into shell + PayWithdrawalsList flat sibling trait - Add process/policy callout, open/paid/fee stats, status views with counts - Filter by source and payout method; reset keeps the status view - Show net payout with gross/fee breakdown, copyable payee, note column - Replace inline select form with per-row actions and a confirm dialog; reject requires a reason; double-submit guard; retry reuses the idempotency key; redirect back preserving filters and paging - Withdrawal: add get_status_counts() and method filter; get_stats() now returns open_gross / paid_net / paid_fee - Remove unused REST routes (/payment/withdrawals, /transition), admin_withdrawals(), update_status(), has_open_withdrawal(), count_open(), resolve_gross_amount() Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1d6bc8f7cc
commit
d98f8d7975
9 files changed
+862
-414
No files matched your search
@@ -43,7 +43,7 @@ const pages = {
|
||||
products: ['PayProducts', 'PayProductsList', 'PayProductsEditor'].map((f) => read(`src/Admin/Native/${f}.php`)).join('\n'),
|
||||
coupons: read('src/Admin/Native/PayCoupons.php'),
|
||||
income: ['PayIncome', 'PayIncomeList'].map((f) => read(`src/Admin/Native/${f}.php`)).join('\n'),
|
||||
withdrawals: read('src/Admin/Native/PayWithdrawals.php'),
|
||||
withdrawals: ['PayWithdrawals', 'PayWithdrawalsList'].map((f) => read(`src/Admin/Native/${f}.php`)).join('\n'),
|
||||
chargeCards,
|
||||
};
|
||||
|
||||
@@ -143,10 +143,17 @@ test('每页都在查询前夹取页码,越界时重查一次', () => {
|
||||
'创作分成必须在查询列表前完成计数与页码夹取'
|
||||
);
|
||||
|
||||
// 提现审核同样先按状态计数夹取页码,再只查一次列表。
|
||||
assert.equal(count(pages.withdrawals, /\$svc->get_all\(/g), 1, '提现审核只应查询一次列表');
|
||||
assert.ok(
|
||||
pages.withdrawals.indexOf('get_status_counts(') < pages.withdrawals.indexOf('if ($page_num > $pages) {')
|
||||
&& pages.withdrawals.indexOf('if ($page_num > $pages) {') < pages.withdrawals.indexOf('$svc->get_all('),
|
||||
'提现审核必须在查询列表前完成计数与页码夹取'
|
||||
);
|
||||
|
||||
const requeries = {
|
||||
products: [/\$query\s*=\s*\$this->query_paid_posts\(/g],
|
||||
coupons: [/\$svc->get_list\(/g],
|
||||
withdrawals: [/\$svc->get_all\(/g],
|
||||
chargeCards: [/\$svc->get_list\(/g],
|
||||
};
|
||||
|
||||
|
||||
@@ -59,8 +59,9 @@ test('orders have no independent flow page or visible flow number', () => {
|
||||
assert.equal(fs.existsSync(path.join(root, 'src/Finance/FinancialFlowQuery.php')), false)
|
||||
assert.match(payOrders, /订单明细/)
|
||||
assert.doesNotMatch(payOrders, /账本流水号|资金流水号/)
|
||||
assert.match(read('src/Admin/Native/PayWithdrawals.php'), /esc_html__\('订单号'/)
|
||||
assert.doesNotMatch(read('src/Admin/Native/PayWithdrawals.php'), /esc_html__\('流水号'|提现单号/)
|
||||
const withdrawals = ['PayWithdrawals', 'PayWithdrawalsList'].map((f) => read(`src/Admin/Native/${f}.php`)).join('\n')
|
||||
assert.match(withdrawals, /esc_html__\('订单号'/)
|
||||
assert.doesNotMatch(withdrawals, /esc_html__\('流水号'|提现单号/)
|
||||
// 前台订单详情只展示公开订单号,账本流水号不下发也不展示。
|
||||
assert.match(read('assets/js/order-center.js'), /\["订单号", order\.order_number\]/)
|
||||
assert.doesNotMatch(read('assets/js/order-center.js'), /flow_number|账本流水号/)
|
||||
|
||||
Reference in new issue
Block a user