feat(admin): platform orders list link to subscription show
This commit is contained in:
@@ -261,7 +261,13 @@
|
|||||||
<span class="muted">未同步</span>
|
<span class="muted">未同步</span>
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td>{{ $order->siteSubscription?->subscription_no ?: '-' }}</td>
|
<td>
|
||||||
|
@if($order->siteSubscription)
|
||||||
|
<a href="/admin/site-subscriptions/{{ $order->siteSubscription->id }}">{{ $order->siteSubscription->subscription_no }}</a>
|
||||||
|
@else
|
||||||
|
<span class="muted">-</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
<td>{{ optional($order->siteSubscription?->ends_at)->format('Y-m-d H:i:s') ?: '-' }}</td>
|
<td>{{ optional($order->siteSubscription?->ends_at)->format('Y-m-d H:i:s') ?: '-' }}</td>
|
||||||
<td>{{ data_get($order->meta, 'subscription_activation.synced_at') ?: '-' }}</td>
|
<td>{{ data_get($order->meta, 'subscription_activation.synced_at') ?: '-' }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -174,6 +174,46 @@ class AdminPlatformOrderTest extends TestCase
|
|||||||
->assertSee('模拟失败')
|
->assertSee('模拟失败')
|
||||||
->assertSee('余额不足');
|
->assertSee('余额不足');
|
||||||
|
|
||||||
|
// 订阅号列应可点击进入订阅详情(提升治理联动效率)
|
||||||
|
$sub = \App\Models\SiteSubscription::query()->create([
|
||||||
|
'merchant_id' => $merchant->id,
|
||||||
|
'plan_id' => $plan->id,
|
||||||
|
'status' => 'activated',
|
||||||
|
'source' => 'manual',
|
||||||
|
'subscription_no' => 'SUB_LINK_0001',
|
||||||
|
'plan_name' => $plan->name,
|
||||||
|
'billing_cycle' => $plan->billing_cycle,
|
||||||
|
'period_months' => 1,
|
||||||
|
'amount' => 10,
|
||||||
|
'starts_at' => now()->subDay(),
|
||||||
|
'ends_at' => now()->addMonth(),
|
||||||
|
'activated_at' => now()->subDay(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
PlatformOrder::query()->create([
|
||||||
|
'merchant_id' => $merchant->id,
|
||||||
|
'plan_id' => $plan->id,
|
||||||
|
'site_subscription_id' => $sub->id,
|
||||||
|
'order_no' => 'PO_SUB_LINK_0001',
|
||||||
|
'order_type' => 'renewal',
|
||||||
|
'status' => 'activated',
|
||||||
|
'payment_status' => 'paid',
|
||||||
|
'plan_name' => '专业版(月付)',
|
||||||
|
'billing_cycle' => 'monthly',
|
||||||
|
'period_months' => 1,
|
||||||
|
'quantity' => 1,
|
||||||
|
'payable_amount' => 199,
|
||||||
|
'paid_amount' => 199,
|
||||||
|
'placed_at' => now()->subMinutes(2),
|
||||||
|
'paid_at' => now()->subMinutes(1),
|
||||||
|
'activated_at' => now(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->get('/admin/platform-orders?keyword=PO_SUB_LINK_0001')
|
||||||
|
->assertOk()
|
||||||
|
->assertSee('SUB_LINK_0001')
|
||||||
|
->assertSee('/admin/site-subscriptions/' . $sub->id);
|
||||||
|
|
||||||
// 只看已同步:构造一条带有 subscription_activation 的订单 + 批量同步审计(用于列表展示)
|
// 只看已同步:构造一条带有 subscription_activation 的订单 + 批量同步审计(用于列表展示)
|
||||||
PlatformOrder::query()->where('order_no', 'PO202603100101')->update([
|
PlatformOrder::query()->where('order_no', 'PO202603100101')->update([
|
||||||
'meta' => [
|
'meta' => [
|
||||||
|
|||||||
Reference in New Issue
Block a user