feat: dashboard merchant revenue rank top5 7d
This commit is contained in:
@@ -114,9 +114,49 @@
|
||||
<div class="muted muted-xs mt-10">说明:先接入最小可用趋势数据;后续再补时间范围切换、维度切换与可视化图表。</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3 class="mt-0">排行</h3>
|
||||
<div class="muted">(占位)后续接入:站点续费金额排行、套餐销量排行、异常订单排行等。</div>
|
||||
<div class="muted muted-xs mt-10">说明:后续会补“时间范围切换 + 维度切换”的渐进增强交互。</div>
|
||||
<h3 class="mt-0">排行(近7天站点收入 Top5)</h3>
|
||||
@php
|
||||
$rankRows = (array) ($merchantRevenueRank7d ?? []);
|
||||
$rankTotal = 0.0;
|
||||
foreach ($rankRows as $r) {
|
||||
$rankTotal += (float) ($r['paid_sum'] ?? 0);
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class="muted">Top5 合计已付 ¥{{ number_format($rankTotal, 2) }}</div>
|
||||
|
||||
<table class="mt-10" data-role="merchant-revenue-rank-7d">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>站点</th>
|
||||
<th>订单数</th>
|
||||
<th>已付金额</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($rankRows as $row)
|
||||
@php
|
||||
$mid = (int) ($row['merchant_id'] ?? 0);
|
||||
$mname = (string) (($merchantIdToName[$mid] ?? '') ?: ('#' . $mid));
|
||||
$merchantOrdersUrl = \App\Support\BackUrl::withBack(
|
||||
'/admin/platform-orders?' . \Illuminate\Support\Arr::query(['merchant_id' => $mid]),
|
||||
$selfWithoutBack
|
||||
);
|
||||
@endphp
|
||||
<tr>
|
||||
<td><a class="link" href="{!! $merchantOrdersUrl !!}">{{ $mname }}</a></td>
|
||||
<td>{{ (int) ($row['count'] ?? 0) }}</td>
|
||||
<td>¥{{ number_format((float) ($row['paid_sum'] ?? 0), 2) }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="3" class="muted">暂无数据</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="muted muted-xs mt-10">说明:先落最小可用 Top5 排行;后续补时间范围切换、维度切换与异常排行。</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user