Admin subscriptions: expiring 7d add merchant+plan top10 and renewal CTA

This commit is contained in:
萝卜
2026-03-17 00:54:17 +08:00
parent 3ba8018bf9
commit aca99d1f30
3 changed files with 152 additions and 0 deletions

View File

@@ -147,6 +147,58 @@
@endforelse
</tbody>
</table>
<div class="mt-16">
<div class="muted"><strong>7天内到期|站点 + 套餐维度提醒清单Top10</strong></div>
<div class="muted muted-xs mt-6">用于更精确续费下单:按到期订阅数排序,展示最早到期时间;并提供 merchant+plan 的续费下单入口。</div>
<table class="mt-10" data-role="expiring-7d-merchant-plan-top10">
<thead>
<tr>
<th>站点</th>
<th>套餐</th>
<th>到期订阅数</th>
<th>最早到期</th>
</tr>
</thead>
<tbody>
@forelse(($expiryMerchantPlanRows ?? []) as $row)
@php
$mid = (int) ($row['merchant_id'] ?? 0);
$mname = (string) ($row['merchant_name'] ?? '');
$pid = (int) ($row['plan_id'] ?? 0);
$pname = (string) ($row['plan_name'] ?? '');
$cnt = (int) ($row['count'] ?? 0);
$minEndsAt = (string) ($row['min_ends_at'] ?? '');
$mpUrl = $buildSelfUrl(['merchant_id' => $mid, 'plan_id' => $pid, 'page' => null]);
$renewalCtaUrlByMerchantPlan = \App\Support\BackUrl::withBack('/admin/platform-orders/create?' . \Illuminate\Support\Arr::query([
'order_type' => 'renewal',
'require_subscription' => '1',
'merchant_id' => $mid,
'plan_id' => $pid,
]), $selfWithoutBack);
@endphp
<tr>
<td><a class="link" href="{!! $mpUrl !!}">{{ $mname !== '' ? $mname : ('站点#' . $mid) }}</a></td>
<td>{{ $pname !== '' ? $pname : ('套餐#' . $pid) }}</td>
<td>{{ $cnt }}</td>
<td>
{{ $minEndsAt !== '' ? $minEndsAt : '-' }}
<div class="muted muted-xs mt-6">
<a class="link" href="{!! $renewalCtaUrlByMerchantPlan !!}">去创建续费订单</a>
<span class="muted">merchant+plan 预填)</span>
</div>
</td>
</tr>
@empty
<tr>
<td colspan="4" class="muted">暂无数据</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
@endif