fix(frontend): 用户中心余额与积分记录不再拼接括号内容
记录行只保留中文变动原因、时间与变动额,移除名称后的(引用键/备注/提现单号)拼接。 同步清理该改动产生的死代码:$record_note 计算块、.uc-transactions__remark 样式、LedgerQuery 中已无消费者的 financial_flow LEFT JOIN 与 withdrawal_number 字段,以及 credits-wallet.php 里恒为 true 的 $skip_wallet_ledger 双路分支。
This commit is contained in:
1 parent
0d617d88c9
commit
32e76b440f
8 files changed
+16
-47
No files matched your search
@@ -21,16 +21,13 @@ defined('ABSPATH') || exit;
|
||||
$credits_page = ($asset_request['asset'] ?? '') === 'points'
|
||||
? max(1, (int) ($asset_request['page'] ?? 1))
|
||||
: 1;
|
||||
$log = \AKSRT\Ledger\LedgerQuery::get_instance()->history(['user_id' => $user_id, 'asset' => 'points', 'page' => $credits_page, 'per_page' => 10]);
|
||||
$log = \AKSRT\Ledger\LedgerQuery::get_instance()->history(['user_id' => $user_id, 'asset' => 'points', 'page' => $credits_page, 'per_page' => 10]);
|
||||
if (!empty($log['items'])) :
|
||||
?>
|
||||
<div class="uc-transactions__list">
|
||||
<?php foreach ($log['items'] as $row) :
|
||||
$delta = (int) $row['delta_minor'];
|
||||
$delta_class = $delta >= 0 ? 'is-positive' : 'is-negative';
|
||||
$record_note = (string) $row['reason'] === 'points_exchange'
|
||||
? (string) $row['ref_key']
|
||||
: (string) $row['remark'];
|
||||
?>
|
||||
<div class="uc-transactions__item">
|
||||
<div class="uc-transactions__icon <?php echo esc_attr($delta_class); ?>">
|
||||
@@ -39,9 +36,6 @@ defined('ABSPATH') || exit;
|
||||
<div class="uc-transactions__info">
|
||||
<div class="uc-transactions__reason">
|
||||
<?php echo esc_html(aksrt_asset_reason_label((string) $row['reason'])); ?>
|
||||
<?php if ($record_note !== '') : ?>
|
||||
<span class="uc-transactions__remark">(<?php echo esc_html($record_note); ?>)</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="uc-transactions__time">
|
||||
<?php echo esc_html(get_date_from_gmt((string) $row['created_at'], 'Y-m-d H:i')); ?>
|
||||
|
||||
@@ -33,12 +33,6 @@ $wlog = \AKSRT\Ledger\LedgerQuery::get_instance()->history([
|
||||
$delta = (int) $row['delta_minor'];
|
||||
$delta_class = $delta >= 0 ? 'is-positive' : 'is-negative';
|
||||
$delta_txt = ($delta > 0 ? '+' : '-') . \AKSRT\Ledger\AssetAmount::from_minor(\AKSRT\Ledger\AssetType::BALANCE, abs($delta))->formatted();
|
||||
$record_note = (string) $row['reason'] === 'points_exchange'
|
||||
? (string) $row['ref_key']
|
||||
: (string) ($row['remark'] ?? '');
|
||||
if (in_array((string) $row['reason'], ['withdraw_hold', 'withdraw_refund'], true)) {
|
||||
$record_note = (string) ($row['withdrawal_number'] ?? '');
|
||||
}
|
||||
?>
|
||||
<div class="uc-transactions__item">
|
||||
<div class="uc-transactions__icon <?php echo esc_attr($delta_class); ?>">
|
||||
@@ -47,9 +41,6 @@ $wlog = \AKSRT\Ledger\LedgerQuery::get_instance()->history([
|
||||
<div class="uc-transactions__info">
|
||||
<div class="uc-transactions__reason">
|
||||
<?php echo esc_html(aksrt_asset_reason_label((string) $row['reason'])); ?>
|
||||
<?php if ($record_note !== '') : ?>
|
||||
<span class="uc-transactions__remark">(<?php echo esc_html($record_note); ?>)</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="uc-transactions__time"><?php echo esc_html(get_date_from_gmt((string) $row['created_at'], 'Y-m-d H:i')); ?></div>
|
||||
</div>
|
||||
|
||||
@@ -243,7 +243,3 @@ endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (empty($skip_wallet_ledger)) : ?>
|
||||
<?php require __DIR__ . '/credits-wallet-ledger.php'; ?>
|
||||
<?php endif; ?>
|
||||
@@ -22,11 +22,7 @@ if ($show_wallet || $show_credits) :
|
||||
<div class="uc-assets-row<?php echo ($show_wallet && $show_credits) ? ' uc-assets-row--dual' : ''; ?>">
|
||||
<?php if ($show_wallet) : ?>
|
||||
<div class="uc-assets-col">
|
||||
<?php
|
||||
// Ledger moved to tab section below.
|
||||
$skip_wallet_ledger = true;
|
||||
require $dir . '/credits-wallet.php';
|
||||
?>
|
||||
<?php require $dir . '/credits-wallet.php'; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($show_credits) : ?>
|
||||
|
||||
Reference in new issue
Block a user