From 39c92017d98974d2c07c7540c1ede7d68559e842 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Aug 2026 23:43:16 +0800 Subject: [PATCH] feat(user-center): merge promotion rewards into revenue --- assets/css/routes/user-center/revenue.css | 544 +++++++++++++++++- assets/js/revenue-invite.js | 225 ++++++++ inc/helpers/aksrt-user-center.php | 13 +- .../user-center-renderers/profile-revenue.php | 230 ++++++-- .../user-center-renderers/sidebar-nav.php | 9 +- inc/modules/user-parts/urls.php | 4 +- src/Core/ScriptsPart1b.php | 14 +- src/Credits/Balance.php | 1 + src/Credits/Invite.php | 32 +- src/Payment/Rebate.php | 89 ++- src/Settings/UserRuntime.php | 2 +- src/User/Center.php | 36 +- templates/pages/page-sign.php | 4 +- templates/parts/modal-auth.php | 4 +- 14 files changed, 1048 insertions(+), 159 deletions(-) create mode 100644 assets/js/revenue-invite.js diff --git a/assets/css/routes/user-center/revenue.css b/assets/css/routes/user-center/revenue.css index 0486d8bf..31e436d4 100644 --- a/assets/css/routes/user-center/revenue.css +++ b/assets/css/routes/user-center/revenue.css @@ -1,24 +1,520 @@ -.uc-content .uc-revenue-card { margin: 0 0 24px; padding: 20px; border: 1px solid var(--color-line-soft, rgba(0,0,0,.06)); border-radius: 14px; background: var(--surface-1); } -.uc-content .uc-revenue-card__header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; } -.uc-content .uc-revenue-card__icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: #fff; background: #ce6b35; } -.uc-content .uc-revenue-card__header p { margin: 0 0 2px; color: var(--color-ink-4); font-size: 12px; } -.uc-content .uc-revenue-card__header h3 { margin: 0; color: var(--color-ink); font-size: 18px; } -.uc-content .uc-revenue-card .aksrt-revenue-page__stats { margin-bottom: 18px; } -.uc-content #panel-revenue.dashboard-panel { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; } -.uc-content .uc-revenue-panel { padding: 4px 0; } -.uc-content .uc-revenue-panel__header { margin-bottom: 20px; } -.uc-content .uc-revenue-panel__header p { margin: 0 0 4px; color: var(--color-primary); font-size: 12px; font-weight: 700; } -.uc-content .uc-revenue-panel__header h2 { margin: 0; color: var(--color-ink); font-size: 22px; } -.uc-content .uc-revenue-panel__header > span { display: block; margin-top: 7px; color: var(--color-ink-4); font-size: 13px; } -.uc-content .aksrt-revenue-page__layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; } -.uc-content .aksrt-revenue-page__panel, -.uc-content .aksrt-revenue-page__section { padding: 20px; border: 1px solid var(--color-line-soft, rgba(0,0,0,.06)); border-radius: 14px; background: var(--surface-1); } -.uc-content .aksrt-revenue-page__panel h3, -.uc-content .aksrt-revenue-page__section h3 { margin: 0 0 14px; font-size: 16px; } -.uc-content .aksrt-revenue-page__withdraw-form { display: grid; gap: 12px; } -.uc-content .aksrt-revenue-page__withdraw-form label { display: grid; gap: 6px; color: var(--color-ink-3); font-size: 13px; } -.uc-content .aksrt-revenue-page__withdraw-form input, -.uc-content .aksrt-revenue-page__withdraw-form select, -.uc-content .aksrt-revenue-page__withdraw-form textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--color-line-soft, rgba(0,0,0,.1)); border-radius: 8px; color: var(--color-ink); background: var(--surface-2); } -.uc-content .aksrt-revenue-page__form-msg.is-error { color: var(--color-error, #dc2626); } -@media (max-width: 640px) { .uc-content .aksrt-revenue-page__layout { grid-template-columns: 1fr; } } +/** + * User Center - commission and promotion rewards. + */ + +.uc-content #panel-revenue.dashboard-panel { + padding: 0; + border: 0; + border-radius: 0; + background: transparent; + box-shadow: none; +} + +.uc-revenue-panel { + display: grid; + gap: 20px; + padding: 4px 0; +} + +.uc-commission-summary { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 16px; +} + +.uc-commission-card { + position: relative; + display: flex; + align-items: center; + gap: 15px; + min-width: 0; + min-height: 142px; + padding: 22px; + overflow: hidden; + border: 1px solid var(--color-line-soft, rgba(15, 23, 42, .08)); + border-radius: 8px; + background: var(--surface-1); + box-shadow: 0 6px 18px rgba(15, 23, 42, .05); +} + +.uc-commission-card__icon { + display: grid; + flex: 0 0 48px; + width: 48px; + height: 48px; + place-items: center; + border-radius: 8px; + color: #fff; + background: #2563a8; + font-size: 19px; +} + +.uc-commission-card--balance .uc-commission-card__icon { + background: #c95a31; +} + +.uc-commission-card__body { + min-width: 0; +} + +.uc-commission-card__body > span, +.uc-commission-card__body > p { + display: block; + color: var(--color-ink-4); + font-size: 12px; +} + +.uc-commission-card__body > span { + margin-bottom: 5px; +} + +.uc-commission-card__body strong { + display: block; + color: var(--color-ink); + font-size: 30px; + font-variant-numeric: tabular-nums; + line-height: 1.15; +} + +.uc-commission-card--ratio .uc-commission-card__body strong { + color: #2563a8; +} + +.uc-commission-card__body strong small { + margin-left: 2px; + font-size: 16px; +} + +.uc-commission-card__body p { + margin: 6px 0 0; + line-height: 1.45; +} + +.uc-commission-card__action { + display: inline-flex; + align-items: center; + gap: 7px; + flex: 0 0 auto; + margin-left: auto; + padding: 9px 13px; + border: 0; + border-radius: 7px; + color: #fff; + background: var(--color-primary); + font-size: 13px; + cursor: pointer; +} + +.uc-commission-card__action:hover { + color: #fff; + filter: brightness(.95); +} + +.uc-reward-area { + display: grid; + gap: 16px; + padding: 4px 0 0; +} + +.uc-reward-area__heading { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: 12px; +} + +.uc-reward-area__heading h3, +.uc-reward-list-heading h4, +.uc-reward-block h4 { + margin: 0; + color: var(--color-ink); + font-size: 16px; +} + +.uc-reward-area__heading > span, +.uc-reward-list-heading p, +.uc-reward-block__heading p { + margin: 0; + color: var(--color-ink-4); + font-size: 12px; +} + +.uc-reward-tabs { + display: flex; + gap: 4px; + overflow-x: auto; + border-bottom: 1px solid var(--color-line-soft, rgba(15, 23, 42, .08)); +} + +.uc-reward-tabs a { + position: relative; + flex: 0 0 auto; + padding: 10px 16px; + color: var(--color-ink-3); + font-size: 14px; + text-decoration: none; +} + +.uc-reward-tabs a::after { + position: absolute; + right: 12px; + bottom: -1px; + left: 12px; + height: 2px; + background: transparent; + content: ""; +} + +.uc-reward-tabs a:hover, +.uc-reward-tabs a.is-active { + color: var(--color-primary); +} + +.uc-reward-tabs a.is-active { + font-weight: 700; +} + +.uc-reward-tabs a.is-active::after { + background: var(--color-primary); +} + +.uc-reward-pane { + display: grid; + gap: 16px; +} + +.uc-reward-pane--detail { + grid-template-columns: repeat(2, minmax(0, 1fr)); +} + +.uc-reward-block { + display: grid; + gap: 14px; + min-width: 0; + padding: 18px; + border: 1px solid var(--color-line-soft, rgba(15, 23, 42, .07)); + border-radius: 8px; + background: var(--surface-2); +} + +.uc-reward-block__heading { + display: grid; + gap: 5px; +} + +.uc-reward-block__heading p { + line-height: 1.5; +} + +.uc-invite-share { + display: grid; + gap: 10px; +} + +.uc-invite-code { + display: flex; + align-items: baseline; + gap: 10px; + color: var(--color-ink-4); + font-size: 13px; +} + +.uc-invite-code strong { + color: var(--color-ink); + font-size: 19px; + letter-spacing: .08em; +} + +.uc-invite-link-row { + display: flex; + gap: 8px; +} + +.uc-invite-link-row input { + flex: 1 1 auto; + min-width: 0; + height: 40px; + padding: 0 10px; + border: 1px solid var(--color-line-soft, rgba(15, 23, 42, .12)); + border-radius: 7px; + color: var(--color-ink); + background: var(--surface-1); +} + +.uc-reward-status, +.uc-reward-copy-feedback { + min-height: 17px; + margin: 0; + color: var(--color-ink-4); + font-size: 12px; +} + +.uc-reward-status.is-error, +.uc-reward-copy-feedback.is-error { + color: var(--color-error, #dc2626); +} + +.uc-ratio-list { + display: grid; + gap: 0; + margin: 0; +} + +.uc-ratio-list > div { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 0; + border-bottom: 1px solid var(--color-line-soft, rgba(15, 23, 42, .07)); +} + +.uc-ratio-list > div:last-child { + border-bottom: 0; +} + +.uc-ratio-list dt { + color: var(--color-ink-3); + font-size: 13px; +} + +.uc-ratio-list dd { + margin: 0; + color: var(--color-primary); + font-weight: 700; +} + +.uc-total-commission { + display: flex; + align-items: baseline; + gap: 10px; +} + +.uc-total-commission strong { + color: var(--color-ink); + font-size: 28px; + font-variant-numeric: tabular-nums; +} + +.uc-total-commission span { + color: var(--color-ink-4); + font-size: 12px; +} + +.uc-reward-richtext { + color: var(--color-ink-3); + font-size: 13px; + line-height: 1.75; +} + +.uc-reward-richtext p { + margin: 0 0 8px; +} + +.uc-reward-richtext p:last-child { + margin-bottom: 0; +} + +.uc-reward-list-heading { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; +} + +.uc-reward-list-heading > div { + display: grid; + gap: 5px; +} + +.uc-reward-list-heading > strong { + color: var(--color-ink-4); + font-size: 12px; + font-weight: 500; +} + +.uc-commission-list, +.uc-invite-list { + display: grid; + gap: 0; + border-top: 1px solid var(--color-line-soft, rgba(15, 23, 42, .08)); +} + +.uc-commission-row, +.uc-invite-record { + display: flex; + align-items: center; + gap: 12px; + min-width: 0; + padding: 13px 0; + border-bottom: 1px solid var(--color-line-soft, rgba(15, 23, 42, .08)); +} + +.uc-commission-row__icon { + display: grid; + flex: 0 0 34px; + width: 34px; + height: 34px; + place-items: center; + border-radius: 8px; + color: #c95a31; + background: rgba(201, 90, 49, .12); +} + +.uc-commission-row__main, +.uc-invite-record__main { + display: grid; + flex: 1 1 auto; + min-width: 0; + gap: 3px; +} + +.uc-commission-row__main strong, +.uc-invite-record__main strong { + overflow: hidden; + color: var(--color-ink); + font-size: 13px; + text-overflow: ellipsis; + white-space: nowrap; +} + +.uc-commission-row__main span, +.uc-commission-row__main time, +.uc-invite-record__main span { + overflow: hidden; + color: var(--color-ink-4); + font-size: 12px; + text-overflow: ellipsis; + white-space: nowrap; +} + +.uc-commission-row__value { + display: grid; + justify-items: end; + gap: 4px; + flex: 0 0 auto; +} + +.uc-commission-row__value strong { + color: #16816c; + font-size: 14px; + font-variant-numeric: tabular-nums; +} + +.uc-commission-row__value span { + padding: 2px 7px; + border-radius: 999px; + color: var(--color-ink-4); + background: var(--surface-1); + font-size: 11px; +} + +.uc-commission-row__value span.is-settled { + color: #16816c; + background: rgba(22, 129, 108, .1); +} + +.uc-commission-row__value span.is-pending { + color: #a86d28; + background: rgba(168, 109, 40, .12); +} + +.uc-invite-record__avatar { + display: grid; + flex: 0 0 36px; + width: 36px; + height: 36px; + place-items: center; + overflow: hidden; + border-radius: 50%; + color: var(--color-primary); + background: var(--surface-2); +} + +.uc-invite-record__avatar img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.uc-invite-record__status { + flex: 0 0 auto; + color: var(--color-ink-4); + font-size: 12px; +} + +.uc-reward-pagination { + display: flex; + justify-content: center; + gap: 6px; + padding-top: 4px; +} + +.uc-reward-pagination a { + display: grid; + width: 30px; + height: 30px; + place-items: center; + border-radius: 6px; + color: var(--color-ink-3); + background: var(--surface-2); + font-size: 12px; + text-decoration: none; +} + +.uc-reward-pagination a.is-active, +.uc-reward-pagination a:hover { + color: #fff; + background: var(--color-primary); +} + +.uc-reward-empty { + margin: 0; + padding: 30px 12px; + color: var(--color-ink-4); + font-size: 13px; + text-align: center; +} + +@media (max-width: 720px) { + .uc-commission-summary, + .uc-reward-pane--detail { + grid-template-columns: 1fr; + } + + .uc-commission-card { + min-height: 120px; + padding: 18px; + } +} + +@media (max-width: 480px) { + .uc-reward-area { + padding: 4px 0 0; + } + + .uc-commission-card { + align-items: flex-start; + flex-wrap: wrap; + } + + .uc-commission-card__action { + margin-left: 63px; + } + + .uc-invite-link-row { + flex-direction: column; + } + + .uc-invite-link-row .btn-primary { + width: 100%; + } + + .uc-invite-record, + .uc-commission-row { + align-items: flex-start; + } + + .uc-commission-row__value { + text-align: right; + } +} diff --git a/assets/js/revenue-invite.js b/assets/js/revenue-invite.js new file mode 100644 index 00000000..862302f6 --- /dev/null +++ b/assets/js/revenue-invite.js @@ -0,0 +1,225 @@ +/** + * Commission center referral link and invited-user records. + */ +(function () { + 'use strict'; + + var root = document.querySelector('[data-aksrt-revenue-page]'); + if (!root) return; + + var data = window.aksrtData || {}; + var rest = data.restUrl || data.apiUrl || ((data.siteUrl || '').replace(/\/$/, '') + '/wp-json/aksrt/v1'); + if (!rest) return; + rest = rest.replace(/\/?$/, ''); + + function api(path) { + return fetch(rest + path, { + credentials: 'same-origin', + headers: { 'X-WP-Nonce': data.restNonce || data.nonce || '' } + }).then(function (response) { + return response.json().catch(function () { return {}; }).then(function (json) { + return { ok: response.ok, json: json }; + }); + }); + } + + function escapeHtml(value) { + return String(value == null ? '' : value).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); + } + + function formatDate(value) { + if (!value || value === '0000-00-00 00:00:00') return ''; + var date = new Date(String(value).replace(' ', 'T') + 'Z'); + return isNaN(date.getTime()) ? String(value).slice(0, 16) : date.toLocaleString(); + } + + var linkInput = root.querySelector('[data-invite-link]'); + var codeEl = root.querySelector('[data-invite-code]'); + var copyBtn = root.querySelector('[data-invite-copy]'); + var statusEl = root.querySelector('[data-invite-status]'); + var feedbackEl = root.querySelector('[data-invite-copy-feedback]'); + var listEl = root.querySelector('[data-invite-list]'); + var totalEl = root.querySelector('[data-invite-total]'); + + function setStatus(text, error) { + if (!statusEl) return; + statusEl.textContent = text || ''; + statusEl.classList.toggle('is-error', !!error); + } + + api('/invite/me').then(function (result) { + if (!result.ok) { + setStatus((result.json && result.json.message) || '推广数据加载失败', true); + return; + } + var payload = result.json || {}; + if (linkInput) linkInput.value = payload.invite_url || ''; + if (codeEl) codeEl.textContent = payload.code || '--'; + if (copyBtn) copyBtn.disabled = !payload.invite_url; + setStatus('推广数据已更新', false); + }).catch(function () { + setStatus('推广数据加载失败,请稍后重试', true); + }); + + function renderPagination(total, current) { + if (!listEl || total <= 10) return; + var nav = root.querySelector('[data-invite-pagination]'); + if (!nav) { + nav = document.createElement('nav'); + nav.className = 'uc-reward-pagination'; + nav.setAttribute('data-invite-pagination', 'true'); + nav.setAttribute('aria-label', '邀请记录分页'); + listEl.parentNode.appendChild(nav); + } + nav.innerHTML = ''; + var pages = Math.ceil(total / 10); + for (var page = 1; page <= pages; page++) { + var url = new URL(window.location.href); + url.searchParams.set('reward_tab', 'users'); + if (page > 1) url.searchParams.set('invite_page', String(page)); + else url.searchParams.delete('invite_page'); + var link = document.createElement('a'); + link.href = url.toString(); + link.textContent = String(page); + link.className = page === current ? 'is-active' : ''; + nav.appendChild(link); + } + } + + function renderList(payload, page) { + if (!listEl) return; + var items = Array.isArray(payload.items) ? payload.items : []; + var total = Number(payload.total || 0); + listEl.classList.remove('is-loading'); + if (totalEl) totalEl.textContent = total ? total + ' 条' : '暂无记录'; + if (!items.length) { + listEl.innerHTML = '

分享链接后,邀请记录会显示在这里。

'; + return; + } + listEl.innerHTML = items.map(function (item) { + var name = item.invitee_name || (item.invitee_id ? '用户 #' + item.invitee_id : '受邀用户'); + var avatar = item.invitee_avatar ? '' : '' + escapeHtml(name.charAt(0)) + ''; + var status = item.status === 'rewarded' ? '已奖励' : (item.status === 'verified' ? '已验证' : '已注册'); + return '
' + avatar + '' + escapeHtml(name) + '' + escapeHtml(formatDate(item.created_at)) + '' + status + '
'; + }).join(''); + var currentPage = Number(payload.page || page); + renderPagination(total, isNaN(currentPage) ? 1 : currentPage); + } + + if (listEl) { + var invitePage = 1; + try { + var requestedPage = parseInt(new URLSearchParams(window.location.search).get('invite_page') || '1', 10); + invitePage = isNaN(requestedPage) ? 1 : Math.max(1, requestedPage); + } catch (_) {} + api('/invite/list?per_page=10&page=' + invitePage).then(function (result) { + if (!result.ok) { + listEl.classList.remove('is-loading'); + listEl.innerHTML = '

邀请记录加载失败,请稍后重试。

'; + return; + } + renderList(result.json || {}, invitePage); + }).catch(function () { + listEl.classList.remove('is-loading'); + listEl.innerHTML = '

邀请记录加载失败,请稍后重试。

'; + }); + } + + if (copyBtn && linkInput) { + copyBtn.addEventListener('click', function () { + if (!linkInput.value) return; + var done = function () { + if (feedbackEl) feedbackEl.textContent = '推广链接已复制'; + copyBtn.disabled = false; + }; + if (navigator.clipboard && navigator.clipboard.writeText) { + navigator.clipboard.writeText(linkInput.value).then(done).catch(function () { linkInput.select(); document.execCommand('copy'); done(); }); + } else { + linkInput.select(); + document.execCommand('copy'); + done(); + } + }); + } + var withdrawModal = document.querySelector('[data-aksrt-commission-withdraw-modal]'); + var withdrawForm = withdrawModal && withdrawModal.querySelector('[data-aksrt-commission-withdraw-form]'); + var withdrawTip = withdrawModal && withdrawModal.querySelector('[data-aksrt-commission-withdraw-tip]'); + var withdrawSubmit = withdrawModal && withdrawModal.querySelector('[data-aksrt-commission-withdraw-submit]'); + var lastWithdrawTrigger = null; + var withdrawBusy = false; + function setWithdrawTip(text, error) { + if (!withdrawTip) return; + withdrawTip.textContent = text || ''; + withdrawTip.classList.toggle('is-error', !!error); + } + function setWithdrawBusy(isBusy) { + withdrawBusy = isBusy; + if (withdrawSubmit) withdrawSubmit.disabled = isBusy; + } + function getWithdrawFocusable() { + return Array.prototype.slice.call(withdrawModal.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')); + } + function closeWithdrawModal() { + if (!withdrawModal || withdrawModal.hidden) return; + withdrawModal.hidden = true; + document.body.classList.remove('uc-modal-open'); + if (lastWithdrawTrigger && typeof lastWithdrawTrigger.focus === 'function') { + lastWithdrawTrigger.focus(); + } + } + if (withdrawModal && withdrawForm) { + document.querySelectorAll('[data-aksrt-commission-withdraw-open]').forEach(function (button) { + button.addEventListener('click', function () { + lastWithdrawTrigger = button; + withdrawModal.hidden = false; + document.body.classList.add('uc-modal-open'); + window.requestAnimationFrame(function () { + var amountInput = withdrawForm.querySelector('[data-aksrt-commission-withdraw-amount]'); + if (amountInput) amountInput.focus(); + }); + }); + }); + withdrawModal.querySelectorAll('[data-aksrt-commission-withdraw-close]').forEach(function (button) { + button.addEventListener('click', closeWithdrawModal); + }); + document.addEventListener('keydown', function (event) { + if (withdrawModal.hidden) return; + if (event.key === 'Escape') { + event.preventDefault(); + closeWithdrawModal(); + return; + } + if (event.key !== 'Tab') return; + var focusable = getWithdrawFocusable(); + if (!focusable.length) return; + var first = focusable[0]; + var last = focusable[focusable.length - 1]; + if (event.shiftKey && document.activeElement === first) { + event.preventDefault(); + last.focus(); + } else if (!event.shiftKey && document.activeElement === last) { + event.preventDefault(); + first.focus(); + } + }); + withdrawForm.addEventListener('submit', function (event) { + event.preventDefault(); + if (withdrawBusy) return; + var values = new FormData(withdrawForm); + var amount = Number(values.get('amount') || 0); + var minimum = Number(root.getAttribute('data-min-amount') || 50); + var account = String(values.get('account_info') || '').trim(); + if (amount < minimum) { setWithdrawTip('提现金额未达到最低额度', true); return; } + if (!account) { setWithdrawTip('请填写收款账户信息', true); return; } + setWithdrawTip('正在提交...', false); + setWithdrawBusy(true); + fetch(rest + '/pay/balance/withdraw', { method: 'POST', credentials: 'same-origin', headers: { 'Content-Type': 'application/json', 'X-WP-Nonce': data.restNonce || data.nonce || '' }, body: JSON.stringify({ amount: amount, method: values.get('method') || 'alipay', account_info: account }) }).then(function (response) { + return response.json().catch(function () { return {}; }).then(function (json) { return { ok: response.ok, json: json }; }); + }).then(function (result) { + if (!result.ok || !result.json || !result.json.success) { setWithdrawBusy(false); setWithdrawTip((result.json && result.json.message) || '提现申请失败', true); return; } + setWithdrawTip('提现申请已提交', false); + window.setTimeout(function () { window.location.reload(); }, 700); + }).catch(function () { setWithdrawBusy(false); setWithdrawTip('网络错误,请稍后重试', true); }); + }); + } +})(); diff --git a/inc/helpers/aksrt-user-center.php b/inc/helpers/aksrt-user-center.php index 5651f978..b91c50e5 100644 --- a/inc/helpers/aksrt-user-center.php +++ b/inc/helpers/aksrt-user-center.php @@ -104,7 +104,7 @@ if (!function_exists('aksrt_get_user_center_tab_url')) { function aksrt_get_user_center_tab_url(string $tab): string { $tab = sanitize_key($tab); if ('invite' === $tab || 'promotion' === $tab) { - $tab = 'promotion'; + $tab = 'revenue'; } $url = remove_query_arg([ 'tab', 'posts_page', 'comments_page', 'favorites_page', 'credits_page', @@ -154,7 +154,6 @@ if (!function_exists('aksrt_capture_user_center_view')) { 'vip' => 'vip', 'orders' => 'orders', 'auth' => 'auth', - 'promotion' => 'promotion', 'revenue' => 'revenue', 'settings' => 'settings', 'header' => 'header', @@ -180,7 +179,7 @@ if (!function_exists('aksrt_capture_user_center_panel')) { * Capture a built-in or registered user-center panel body. */ function aksrt_capture_user_center_panel(string $tab_key, array $tab, array $context): string { - $built_in_tabs = ['profile', 'level', 'posts', 'comments', 'favorites', 'credits', 'vip', 'orders', 'auth', 'promotion', 'revenue', 'settings']; + $built_in_tabs = ['profile', 'level', 'posts', 'comments', 'favorites', 'credits', 'vip', 'orders', 'auth', 'revenue', 'settings']; if (in_array($tab_key, $built_in_tabs, true)) { return aksrt_capture_user_center_view($tab_key, $context); } @@ -288,7 +287,7 @@ if (!function_exists('aksrt_user_center_resolve_tabs')) { if ('signin' === $active || 'assets' === $active) { $active = 'credits'; } elseif ('invite' === $active || 'promotion' === $active) { - $active = 'promotion'; + $active = 'revenue'; } elseif ('vip' === $active) { // Prefer dedicated vip tab when registered; else credits (VIP shop). $active = in_array('vip', $keys, true) ? 'vip' : 'credits'; @@ -347,9 +346,9 @@ if (!function_exists('aksrt_user_center_runtime_config')) { 'activeTab' => $active_tab, 'tabAliases' => [ 'signin' => 'credits', - 'invite' => 'promotion', - 'promotion' => 'promotion', - 'assets' => 'credits', + 'invite' => 'revenue', + 'promotion' => 'revenue', + 'assets' => 'credits', // vip → vip when panel exists; SPA may still map missing keys via server resolve. 'vip' => 'vip', ], diff --git a/inc/helpers/user-center-renderers/profile-revenue.php b/inc/helpers/user-center-renderers/profile-revenue.php index 2745378c..4d426035 100644 --- a/inc/helpers/user-center-renderers/profile-revenue.php +++ b/inc/helpers/user-center-renderers/profile-revenue.php @@ -1,6 +1,6 @@ ' . esc_html__('请先登录', 'aksrt') . ''; - return; + echo '
' . esc_html__('请先登录', 'aksrt') . '
'; + return; } -$show_revenue_section = !empty($context['show_revenue_section']); -$revenue_view = function_exists('aksrt_get_revenue_page_view') - ? aksrt_get_revenue_page_view($user_id) - : ['balance' => 0, 'total_earned' => 0, 'total_withdrawn' => 0, 'records' => []]; -$settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_withdrawal_settings() : []; -$min_amount = (float) ($settings['min_amount'] ?? 50); -$fee_rate = (float) ($settings['service_charge_rate'] ?? 0); -$withdraw_text = (string) ($settings['text'] ?? ''); -$withdrawals = class_exists('\AKSRT\Payment\Withdrawal') - ? \AKSRT\Payment\Withdrawal::get_instance()->get_user_withdrawals($user_id, ['limit' => 20]) - : []; -$records = (array) ($revenue_view['records'] ?? []); -$page = max(1, isset($_GET['rev_page']) ? (int) $_GET['rev_page'] : 1); -$per_page = 20; -$total_pages = max(1, (int) ceil(max(1, count($records)) / $per_page)); -$paged_records = array_slice($records, ($page - 1) * $per_page, $per_page); -$revenue_url = static function (int $target_page): string { - $url = function_exists('aksrt_get_user_center_tab_url') ? aksrt_get_user_center_tab_url('revenue') : home_url('/profile/?tab=revenue'); - return $target_page > 1 ? add_query_arg('rev_page', $target_page, $url) : $url; -}; -?> -
+$affiliate = class_exists('\AKSRT\Settings\Settings') + ? \AKSRT\Settings\Settings::get_payment_affiliate_settings() + : []; +$withdrawal = class_exists('\AKSRT\Settings\Settings') + ? \AKSRT\Settings\Settings::get_withdrawal_settings() + : []; +$all_settings = class_exists('\AKSRT\Settings\Settings') + ? \AKSRT\Settings\Settings::get_all() + : []; +$withdraw_on = !empty($all_settings['pay_balance_withdraw_s']) + && class_exists('\AKSRT\Credits\Balance') + && \AKSRT\Credits\Balance::enabled(); +if ($withdraw_on && class_exists('\AKSRT\Settings\Capabilities') && !\AKSRT\Settings\Capabilities::user_can('balance_withdraw', $user_id)) { + $withdraw_on = false; +} +$withdraw_min = max(1, (float) ($all_settings['pay_balance_withdraw_lowest_money'] ?? $all_settings['pay_rebate_withdraw_lowest_money'] ?? $withdrawal['min_amount'] ?? 50)); - -
-
- -
-

-

-
-
-
-
¥
-
¥
-
¥
-
-
-

-

¥

-
-

¥
1) : ?>

-
- +$commission_stats = class_exists('\AKSRT\Payment\Rebate') + ? \AKSRT\Payment\Rebate::get_instance()->get_stats($user_id) + : ['total' => 0, 'pending' => 0, 'pending_amount' => 0, 'settled' => 0, 'total_amount' => 0, 'settled_amount' => 0]; +$available_commission = class_exists('\AKSRT\Credits\Balance') + ? (float) \AKSRT\Credits\Balance::balance($user_id) + : (float) ($commission_stats['settled_amount'] ?? 0); +$vip_ratios = is_array($affiliate['user_ratio'] ?? null) ? $affiliate['user_ratio'] : []; +$commission_ratio = (int) ($vip_ratios['user'] ?? $affiliate['ratio'] ?? 0); +$current_vip = function_exists('aksrt_get_user_vip_level') ? (int) aksrt_get_user_vip_level($user_id) : 0; +if ($current_vip >= 2 && !empty($vip_ratios['vip2'])) { + $commission_ratio = (int) $vip_ratios['vip2']; +} elseif ($current_vip >= 1 && !empty($vip_ratios['vip1'])) { + $commission_ratio = (int) $vip_ratios['vip1']; +} +$details_title = trim((string) ($affiliate['text']['details_title'] ?? '')) ?: __('返佣详解', 'aksrt'); +$details_text = trim((string) ($affiliate['text']['details'] ?? '')); +if ($details_text === '') { + $details_text = trim((string) ($affiliate['note'] ?? '')) ?: __('好友通过推广链接完成符合条件的订单后,系统会按当前佣金比例记录返佣,结算后进入可提现余额。', 'aksrt'); +} + +$active_reward_tab = sanitize_key((string) ($_GET['reward_tab'] ?? 'detail')); +if (!in_array($active_reward_tab, ['detail', 'orders', 'users'], true)) { + $active_reward_tab = 'detail'; +} +$base_url = function_exists('aksrt_get_user_center_tab_url') + ? aksrt_get_user_center_tab_url('revenue') + : home_url('/profile/?tab=revenue'); +$reward_url = static function (string $tab, array $extra = []) use ($base_url): string { + return add_query_arg(array_merge(['reward_tab' => $tab], $extra), $base_url); +}; +$format_amount = static function ($amount): string { + return number_format_i18n((float) $amount, 2); +}; + +$commission_page = max(1, (int) ($_GET['commission_page'] ?? 1)); +$commission_view = class_exists('\AKSRT\Payment\Rebate') + ? \AKSRT\Payment\Rebate::get_instance()->get_list([ + 'user_id' => $user_id, + 'limit' => 10, + 'offset' => ($commission_page - 1) * 10, + ]) + : ['items' => [], 'total' => 0, 'max_pages' => 1, 'page' => 1]; +$commission_items = (array) ($commission_view['items'] ?? []); +$commission_total_pages = max(1, (int) ($commission_view['max_pages'] ?? ceil(max(1, (int) ($commission_view['total'] ?? 0)) / 10))); +if ($commission_page > $commission_total_pages) { + $commission_page = $commission_total_pages; + if (class_exists('\AKSRT\Payment\Rebate')) { + $commission_view = \AKSRT\Payment\Rebate::get_instance()->get_list([ + 'user_id' => $user_id, + 'limit' => 10, + 'offset' => ($commission_page - 1) * 10, + ]); + } +} +$commission_items = (array) ($commission_view['items'] ?? []); +$status_labels = [ + 'pending' => __('待结算', 'aksrt'), + 'settled' => __('已结算', 'aksrt'), + 'cancelled' => __('已取消', 'aksrt'), +]; +?> +
+
+
+
+
+ + % +

+
+
+
+
+
+ + +

+
+ + + +
+
+ +
+
+

+ +
+ + + +
+
+

+
+
--
+ + +

+

+
+
+
+

+
+
%
+
VIP 1
%
+
VIP 2
%
+
+
+
+

+
+
+
+

+
+
+
+ +
+

+ +
+ display_name : __('推广用户', 'aksrt'); + ?> +
+
+ +
+ 1) : ?> +

+
+ +
+

+

+
+ +
+ + + + diff --git a/inc/helpers/user-center-renderers/sidebar-nav.php b/inc/helpers/user-center-renderers/sidebar-nav.php index 49d7c863..d36433a6 100644 --- a/inc/helpers/user-center-renderers/sidebar-nav.php +++ b/inc/helpers/user-center-renderers/sidebar-nav.php @@ -11,7 +11,6 @@ $level_url = isset($dashboard_tabs['level']) ? aksrt_get_user_center_tab_url('level') : ''; $auth_url = isset($dashboard_tabs['auth']) ? aksrt_get_user_center_tab_url('auth') : ''; -$promotion_url = isset($dashboard_tabs['promotion']) ? aksrt_get_user_center_tab_url('promotion') : ''; $orders_available = isset($dashboard_tabs['orders']); $orders_url = $orders_available ? (string) ($orders_url ?? '') : ''; @@ -22,13 +21,7 @@ $services = array_values(array_filter([ 'tone' => 'level', 'url' => $level_url, ], - [ - 'label' => __('推广中心', 'aksrt'), - 'icon' => 'bullhorn', - 'tone' => 'promotion', - 'url' => $promotion_url, - 'tab' => 'promotion', - ], + [ 'label' => __('官方认证', 'aksrt'), 'icon' => 'id-badge', diff --git a/inc/modules/user-parts/urls.php b/inc/modules/user-parts/urls.php index 1d81e717..c6395dca 100644 --- a/inc/modules/user-parts/urls.php +++ b/inc/modules/user-parts/urls.php @@ -32,8 +32,8 @@ function aksrt_get_user_center_url(string $tab = ''): string { 'assets' => 'credits', 'vip' => 'vip', // dedicated vip tab when registered; resolver falls back if missing 'signin' => 'credits', - 'invite' => 'promotion', - 'promotion' => 'promotion', + 'invite' => 'revenue', + 'promotion' => 'revenue', ]; if (isset($aliases[$tab])) { $tab = $aliases[$tab]; diff --git a/src/Core/ScriptsPart1b.php b/src/Core/ScriptsPart1b.php index 7079e49d..508c02b1 100644 --- a/src/Core/ScriptsPart1b.php +++ b/src/Core/ScriptsPart1b.php @@ -702,7 +702,7 @@ $hmb_js = get_template_directory() . '/assets/js/header-newadd.js'; && isset($_GET['tab']) && 'revenue' === sanitize_key((string) wp_unslash($_GET['tab'])) ); - if ($is_revenue_surface) { + if ($is_revenue_surface && !$is_profile_page) { $revenue_js = get_template_directory() . '/assets/js/revenue.js'; wp_enqueue_script( 'aksrt-revenue', @@ -919,6 +919,18 @@ $hmb_js = get_template_directory() . '/assets/js/header-newadd.js'; + if ($is_profile_page) { + $revenue_invite_js_path = get_template_directory() . '/assets/js/revenue-invite.js'; + if (file_exists($revenue_invite_js_path)) { + wp_enqueue_script( + 'aksrt-revenue-invite', + $base_uri . '/assets/js/revenue-invite.js', + ['aksrt-script'], + (string) filemtime($revenue_invite_js_path), + true + ); + } + } // Badges UI: user center + public profile (zibll medal modal/list). if (class_exists('\AKSRT\User\Badges') && \AKSRT\User\Badges::enabled()) { $is_badge_surface = $is_profile_page diff --git a/src/Credits/Balance.php b/src/Credits/Balance.php index f22dd78b..c8bdae00 100644 --- a/src/Credits/Balance.php +++ b/src/Credits/Balance.php @@ -368,6 +368,7 @@ class Balance { 'admin' => __('管理员调整', 'aksrt'), 'exchange_from_credits' => __('积分兑换', 'aksrt'), 'creator_income' => __('创作收益结算', 'aksrt'), + 'rebate' => __('推广返佣结算', 'aksrt'), 'withdraw_hold' => __('提现冻结', 'aksrt'), 'withdraw_refund' => __('提现退回', 'aksrt'), ]; diff --git a/src/Credits/Invite.php b/src/Credits/Invite.php index 2141f6cd..1d022f4e 100644 --- a/src/Credits/Invite.php +++ b/src/Credits/Invite.php @@ -59,18 +59,30 @@ class Invite { 'permission_callback' => function () { return is_user_logged_in(); }, + 'args' => [ + 'page' => [ + 'type' => 'integer', + 'default' => 1, + 'minimum' => 1, + ], + 'per_page' => [ + 'type' => 'integer', + 'default' => 10, + 'minimum' => 1, + 'maximum' => 50, + ], + ], ]); } - - /** 捕获 ?invite=XYZ */ + /** Capture ?ref=XYZ, with legacy ?invite=XYZ support. */ public function capture_invite_cookie(): void { if (is_admin()) return; - if (empty($_GET['invite'])) return; - + $raw_code = $_GET['ref'] ?? $_GET['invite'] ?? ''; + if ($raw_code === '') return; // 邀请注册功能关闭时不处理 if (class_exists('\AKSRT\Settings\Settings') && !\AKSRT\Settings\Settings::invite_registration_enabled()) return; - $code = sanitize_key((string) $_GET['invite']); + $code = sanitize_key(wp_unslash((string) $raw_code)); if ($code === '') return; // 校验邀请码是否对应真实用户 @@ -609,7 +621,7 @@ class Invite { } } - $invite_url = add_query_arg('invite', $code, aksrt_get_register_url()); + $invite_url = add_query_arg('ref', $code, home_url('/')); return new \WP_REST_Response([ 'code' => $code, @@ -626,9 +638,7 @@ class Invite { global $wpdb; $user_id = get_current_user_id(); $page = max(1, (int) $request->get_param('page')); - $per_page = min(50, max(1, (int) $request->get_param('per_page') ?: 20)); - $offset = ($page - 1) * $per_page; - + $per_page = min(50, max(1, (int) $request->get_param('per_page') ?: 10)); $table = \AKSRT\Core\DBMigrator::table('invite'); if (!$table) { return new \WP_REST_Response(['items' => [], 'total' => 0], 200); @@ -638,6 +648,9 @@ class Invite { "SELECT COUNT(*) FROM {$table} WHERE inviter_id = %d", $user_id )); + $total_pages = max(1, (int) ceil($total / $per_page)); + $page = min($page, $total_pages); + $offset = ($page - 1) * $per_page; $rows = $wpdb->get_results($wpdb->prepare( "SELECT * FROM {$table} WHERE inviter_id = %d ORDER BY created_at DESC LIMIT %d OFFSET %d", $user_id, @@ -664,6 +677,7 @@ class Invite { 'total' => $total, 'page' => $page, 'per_page' => $per_page, + 'total_pages' => $total_pages, ], 200); } } diff --git a/src/Payment/Rebate.php b/src/Payment/Rebate.php index b1bb0936..6c4ebea3 100644 --- a/src/Payment/Rebate.php +++ b/src/Payment/Rebate.php @@ -79,31 +79,56 @@ class Rebate { public function settle(int $id): bool { global $wpdb; - $row = $wpdb->get_row($wpdb->prepare( - "SELECT * FROM {$this->table()} WHERE id = %d AND status = %s", - $id, self::STATUS_PENDING - ), ARRAY_A); - - if (!$row) return false; - - $user_id = (int) $row['user_id']; - $amount = (float) $row['amount']; - - $result = $wpdb->update($this->table(), [ - 'status' => self::STATUS_SETTLED, - 'settled_at' => current_time('mysql'), - ], ['id' => $id]); - - if ($result && class_exists('\AKSRT\Credits\Credits')) { - \AKSRT\Credits\Credits::add($user_id, (int) $amount, 'rebate', [ - 'ref_type' => 'rebate', - 'ref_id' => $id, - ]); + if (!class_exists('\AKSRT\Credits\Balance')) { + return false; } - return (bool) $result; - } + $wpdb->query('START TRANSACTION'); + try { + $row = $wpdb->get_row($wpdb->prepare( + "SELECT id, user_id, amount, order_number FROM {$this->table()} WHERE id = %d AND status = %s FOR UPDATE", + $id, + self::STATUS_PENDING + ), ARRAY_A); + if (!is_array($row)) { + $wpdb->query('ROLLBACK'); + return false; + } + $credited = \AKSRT\Credits\Balance::add( + (int) $row['user_id'], + (float) $row['amount'], + 'rebate', + ['type' => 'rebate', 'id' => (int) $row['id']], + sprintf(__('推广返佣结算(订单 %s)', 'aksrt'), (string) $row['order_number']) + ); + if (is_wp_error($credited)) { + $wpdb->query('ROLLBACK'); + return false; + } + + $settled = $wpdb->update( + $this->table(), + [ + 'status' => self::STATUS_SETTLED, + 'settled_at' => current_time('mysql'), + ], + ['id' => $id, 'status' => self::STATUS_PENDING], + ['%s', '%s'], + ['%d', '%s'] + ); + if ($settled !== 1) { + $wpdb->query('ROLLBACK'); + return false; + } + + $wpdb->query('COMMIT'); + return true; + } catch (\Throwable $e) { + $wpdb->query('ROLLBACK'); + return false; + } + } /** * 取消返佣 */ @@ -159,24 +184,32 @@ class Rebate { /** * 获取统计 */ - public function get_stats(): array { + public function get_stats(int $user_id = 0): array { global $wpdb; $table = $this->table(); + $where = ''; + $params = []; + if ($user_id > 0) { + $where = 'WHERE user_id = %d'; + $params[] = $user_id; + } - $row = $wpdb->get_row( - "SELECT + $sql = "SELECT COUNT(*) as total, SUM(CASE WHEN status = 'pending' THEN 1 ELSE 0 END) as pending, + SUM(CASE WHEN status = 'pending' THEN amount ELSE 0 END) as pending_amount, SUM(CASE WHEN status = 'settled' THEN 1 ELSE 0 END) as settled, SUM(amount) as total_amount, SUM(CASE WHEN status = 'settled' THEN amount ELSE 0 END) as settled_amount - FROM {$table}", - ARRAY_A - ); + FROM {$table} {$where}"; + $row = $params + ? $wpdb->get_row($wpdb->prepare($sql, $params), ARRAY_A) + : $wpdb->get_row($sql, ARRAY_A); return [ 'total' => (int) ($row['total'] ?? 0), 'pending' => (int) ($row['pending'] ?? 0), + 'pending_amount' => (float) ($row['pending_amount'] ?? 0), 'settled' => (int) ($row['settled'] ?? 0), 'total_amount' => (float) ($row['total_amount'] ?? 0), 'settled_amount' => (float) ($row['settled_amount'] ?? 0), diff --git a/src/Settings/UserRuntime.php b/src/Settings/UserRuntime.php index bf599c53..aa029a30 100644 --- a/src/Settings/UserRuntime.php +++ b/src/Settings/UserRuntime.php @@ -90,7 +90,7 @@ class UserRuntime { // Built-in switchable panels. VIP is always auto-injected when enabled // by AKSRT\User\Center — keep it allowed for explicit config too. - $allowed_tabs = ['profile', 'level', 'posts', 'comments', 'favorites', 'credits', 'promotion', 'revenue', 'vip', 'orders', 'auth', 'settings']; + $allowed_tabs = ['profile', 'level', 'posts', 'comments', 'favorites', 'credits', 'revenue', 'vip', 'orders', 'auth', 'settings']; $normalized_tabs = ['profile']; foreach ((array) $tabs as $tab) { diff --git a/src/User/Center.php b/src/User/Center.php index 77f5f9d9..4bc29c54 100644 --- a/src/User/Center.php +++ b/src/User/Center.php @@ -91,12 +91,6 @@ class Center { 'priority' => 50, 'type' => 'panel', ], - 'promotion' => [ - 'label' => __('推广中心', 'aksrt'), - 'icon' => 'bullhorn', - 'priority' => 52, - 'type' => 'panel', - ], 'revenue' => [ 'label' => __('收益中心', 'aksrt'), 'icon' => 'chart-line', @@ -133,17 +127,9 @@ class Center { && !empty(\AKSRT\User\Level::settings()['enabled']); $credits_on = class_exists('\AKSRT\Settings\Settings') && \AKSRT\Settings\Settings::credits_enabled(); $balance_on = class_exists('\AKSRT\Credits\Balance') && \AKSRT\Credits\Balance::enabled(); - $invite_on = $credits_on - && class_exists('\AKSRT\Settings\Settings') - && \AKSRT\Settings\Settings::invite_enabled() - && \AKSRT\Settings\Settings::invite_registration_enabled(); - // Promotion (invite) center is its own tab; revenue stays pure earnings/withdrawal. - $promotion_on = $invite_on; $revenue_tab_on = class_exists('\AKSRT\Settings\Settings') - && ( - !empty(\AKSRT\Settings\Settings::get_payment_revenue_settings()['enabled']) - || !empty(\AKSRT\Settings\Settings::get_payment_affiliate_settings()['enabled']) - ); + && !empty(\AKSRT\Settings\Settings::get_payment_affiliate_settings()['enabled']) + && \AKSRT\Settings\Settings::invite_registration_enabled(); $vip_on = class_exists('\AKSRT\Settings\Settings') && !empty(\AKSRT\Settings\Settings::get_payment_vip_settings()['enabled']); @@ -190,20 +176,10 @@ class Center { if (($credits_on || $balance_on) && !in_array('credits', $order, true)) { $order[] = 'credits'; } - if ($promotion_on && !in_array('promotion', $order, true)) { - $insert_at = count($order); - foreach (['credits', 'favorites', 'posts'] as $anchor) { - $idx = array_search($anchor, $order, true); - if ($idx !== false) { - $insert_at = (int) $idx + 1; - break; - } - } - array_splice($order, $insert_at, 0, ['promotion']); - } + if ($revenue_tab_on && !in_array('revenue', $order, true)) { $insert_at = count($order); - foreach (['promotion', 'credits', 'favorites', 'posts'] as $anchor) { + foreach (['credits', 'favorites', 'posts'] as $anchor) { $idx = array_search($anchor, $order, true); if ($idx !== false) { $insert_at = (int) $idx + 1; @@ -234,9 +210,7 @@ class Center { if ($key === 'revenue' && !$revenue_tab_on) { continue; } - if ($key === 'promotion' && !$promotion_on) { - continue; - } + if ($key === 'vip' && !$vip_on) { continue; } diff --git a/templates/pages/page-sign.php b/templates/pages/page-sign.php index 4c265ff6..ba29e121 100644 --- a/templates/pages/page-sign.php +++ b/templates/pages/page-sign.php @@ -122,7 +122,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['user_login'], $_POST[ } $invite_prefill = ''; -if (!empty($_GET['invite'])) { +if (!empty($_GET['ref'])) { + $invite_prefill = sanitize_key(wp_unslash($_GET['ref'])); +} elseif (!empty($_GET['invite'])) { $invite_prefill = sanitize_key(wp_unslash($_GET['invite'])); } elseif (!empty($_COOKIE['aksrt_invite'])) { $invite_prefill = sanitize_key(wp_unslash($_COOKIE['aksrt_invite'])); diff --git a/templates/parts/modal-auth.php b/templates/parts/modal-auth.php index 10bf0ebf..b9f1450c 100644 --- a/templates/parts/modal-auth.php +++ b/templates/parts/modal-auth.php @@ -39,7 +39,9 @@ if (class_exists('\AKSRT\Settings\Settings')) { : (string) ($invite_cfg['open_desc'] ?? ''); } -if (!empty($_GET['invite'])) { +if (!empty($_GET['ref'])) { + $invite_prefill = sanitize_key(wp_unslash($_GET['ref'])); +} elseif (!empty($_GET['invite'])) { $invite_prefill = sanitize_key(wp_unslash($_GET['invite'])); } elseif (!empty($_COOKIE['aksrt_invite'])) { $invite_prefill = sanitize_key(wp_unslash($_COOKIE['aksrt_invite']));