feat(plans): add cross links in summary cards

This commit is contained in:
萝卜
2026-03-14 22:21:29 +00:00
parent 8c04a8fef8
commit 3f2f66b65e
2 changed files with 44 additions and 0 deletions

View File

@@ -139,18 +139,27 @@
<div class="num-md">
<a class="link" href="{!! $safeFullUrlWithQuery(['status' => 'active', 'page' => null]) !!}">{{ $summaryStats['active_plans'] ?? 0 }}</a>
</div>
<div class="muted muted-xs">
<a class="link" href="{!! $safeFullUrlWithQuery(['status' => 'inactive', 'page' => null]) !!}">查看停用套餐</a>
</div>
</div>
<div class="card">
<h3>月付套餐</h3>
<div class="num-md">
<a class="link" href="{!! $safeFullUrlWithQuery(['billing_cycle' => 'monthly', 'page' => null]) !!}">{{ $summaryStats['monthly_plans'] ?? 0 }}</a>
</div>
<div class="muted muted-xs">
<a class="link" href="{!! $safeFullUrlWithQuery(['billing_cycle' => 'yearly', 'page' => null]) !!}">查看年付套餐</a>
</div>
</div>
<div class="card">
<h3>年付套餐</h3>
<div class="num-md">
<a class="link" href="{!! $safeFullUrlWithQuery(['billing_cycle' => 'yearly', 'page' => null]) !!}">{{ $summaryStats['yearly_plans'] ?? 0 }}</a>
</div>
<div class="muted muted-xs">
<a class="link" href="{!! $safeFullUrlWithQuery(['billing_cycle' => 'monthly', 'page' => null]) !!}">查看月付套餐</a>
</div>
</div>
<div class="card">
<h3>关联订阅总量</h3>

View File

@@ -0,0 +1,35 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlanIndexSummaryCardsCrossLinksTest extends TestCase
{
use RefreshDatabase;
protected function loginAsPlatformAdmin(): void
{
$this->seed();
$this->post('/admin/login', [
'email' => 'platform.admin@demo.local',
'password' => 'Platform@123456',
])->assertRedirect('/admin');
}
public function test_summary_cards_should_have_cross_links_for_quick_navigation(): void
{
$this->loginAsPlatformAdmin();
$this->get('/admin/plans')
->assertOk()
->assertSee('查看停用套餐')
->assertSee('查看年付套餐')
->assertSee('查看月付套餐')
->assertSee('status=inactive', false)
->assertSee('billing_cycle=monthly', false)
->assertSee('billing_cycle=yearly', false);
}
}