The field rendered in two places on /user/revenue/: the 我的佣金 card's
meta line and the 累计佣金 row, both gated on a non-zero balance. Remove
both, along with the now-unused $debt_amount local and the dead
.uc-commission-card__debt rule.
Source trace, since the label is only the surface: CommissionLedger::
overview() reads debt_minor from aksrt_commission_debt and returns it as
'debt'; record_debt() books the shortfall when a refund cannot be clawed
back in full, and repay_debt_from_pool() later clears it out of the
commission pool. That mechanism is untouched — arrears still accrue and
still get repaid, the UI just no longer surfaces them. The reference
theme's rebate card has no equivalent concept, so this is not a parity
target either.
Keep 'debt' in the template's overview() fallback array: it mirrors the
real return shape and the repayment path still depends on the value.
Add a contract test asserting the label, its class and the local are gone
from the display layer while overview() keeps returning the key; verified
it fails if the label is reintroduced.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two regressions from the previous commit made /user/revenue/ unusable.
The rewrite dropped data-aksrt-affiliate-poster-modal from the modal shell.
That single attribute was both the JS lookup key and the CSS hook, so
initAffiliatePoster() bailed at `if (!button || !modal) return` — which is
why the 推广海报 button never got un-hidden — and no CSS could target the
shell. Restore it.
With the shell back but still visible, main.css's .flex{display:flex} loads
after bootstrap and matches .modal{display:none} on specificity, so the
resting modal rendered as a full-viewport flex box. Combined with .fade's
opacity:0 that is an invisible overlay swallowing every click on the page.
Pin the resting state to display:none and the open state to flex, the same
way credits.css already does for the charge and points-pay modals — that
file documents this exact trap.
Add a contract test asserting the markup, JS selector and CSS hook share
one attribute and that the resting state is explicitly hidden.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The 推广海报 modal on the revenue page used a bespoke .uc-modal card —
white panel, 12px radius, heavy shadow, title bar, corner × button and a
full-width 保存海报 button — plus a light-gray plate with its own
border-radius around the poster canvas. None of that exists in the
reference theme, so the popup read as bordered and off-spec.
Rebuild the modal on the reference poster-share structure: a borderless
360px .modal-dialog.poster-share centred by .modal.flex.jc, a
.loading-mask overlay while the canvas renders, and the download/close
buttons moved onto a .abs-center.hover-show-con layer that only fades in
on hover. initAffiliatePoster() now drives Bootstrap 3 modal semantics
(.in toggle, .modal-backdrop, body.modal-open, ESC and backdrop-click to
close), mirroring the existing openChargeModal/closeChargeModal pair, and
animates .modal-content from the 220px placeholder to the poster's real
height before clearing the inline styles.
No CSS added — every rule the reference modal needs was already ported.
Drop the now-dead .uc-affiliate-poster rules; the shared .uc-modal shell
and openModal/closeModal stay for the withdraw and transfer modals.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- detail-tab 累计佣金 row now shows 累计 + 已提现 (was 累计/可提现/已提现)
- rebuild poster canvas to match reference layout (768×1168, top banner,
date overlay, blue title bar, bottom bordered box with QR + link)
- copy-link feedback moves from inline text to a toast (notyf), matching
the reference; drop the now-unused data-affiliate-feedback element
Opening the 推广收益 tab was slow because every read path ran settlement
and two COUNT aggregates before the browser could show the link.
- profile-revenue.php: the link input now carries a server-rendered value from
ReferralAttribution::create_link(), so 复制链接 works on first paint instead
of after a REST round trip
- CommissionLedger::overview() no longer calls lazy_settle_due(); the
lazy-settlement hook and its static flag are gone. Settlement runs only on
the existing hourly aksrt_affiliate_settle_due cron, which uses a larger
batch (100 vs 20) and would otherwise re-run up to 20 locked
SELECT..FOR UPDATE + write cycles inside a GET request
- ReferralAttribution::rest_me() drops the lazy_settle_due() call and the
stats() result; stats() itself is deleted — its two COUNTs (one of them
COUNT(DISTINCT source_user_id)) had no consumer left once the 推广人数 row
was removed
- credits.js: reads the link from the already-rendered input and only fetches
/revenue/me for poster config and commission ratio. A failed fetch no longer
blocks copying — it silently skips the poster enhancement
- tests: the lazy-settlement contract is inverted to assert the read path stays
read-only and cron stays wired; new assertions pin the server-rendered value
and the no-COUNT REST payload
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The 推广收益 detail card no longer renders the QR code as its own row. The
card becomes a fixed-label info list: 推广链接 [Url][复制链接][推广海报] /
佣金比例 / 累计佣金 / 返佣详解, mirroring the reference theme's 推广中心 card.
- profile-revenue.php: QR row removed; poster button moved into the link row and
gated server-side on the poster switch; copy label now 复制链接; 推广人数 row
dropped; 返佣详解 heading reads the existing pay_rebate_text_details_title;
dead $vip_ratios, aksrt-revenue-page class and data-min-amount removed
- new affiliate-poster-modal.php: poster previews in a modal before download
(reuses .uc-modal + single-render guard), since the QR now only exists inside
the poster
- credits.js: renderAffiliateQr and its call deleted, along with the dead
[data-affiliate-payers] lookup and the inline ch-width hack; initAffiliatePoster
builds the poster into the modal stage and reveals 保存海报
- PaymentRuntime: expose affiliate details_title
- user-center.js: remove never-defined AKSRTRevenueCenterInit guards (2 sites)
- CSS: revenue-earnings.css pruned to live rules plus the new link-row grid and
poster stage styles; routes/user-center/revenue.css pruned to its only
definitions; dead leaves routes/revenue.css and routes/commerce.css deleted and
dequeued from the user-center part list
- tests: referral-qr-contract test 2 rewritten for the QR-free card, link row and
poster modal; post-visual-contract leaf list updated with regression guards
qrcode.min.js stays enqueued — buildPosterCanvas still draws the QR inside the
poster. Net -833 lines.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>