ui(dashboard): 活跃付费站点入口对齐未到期口径
This commit is contained in:
@@ -326,7 +326,12 @@ class DashboardController extends Controller
|
|||||||
'created_from' => $range30From,
|
'created_from' => $range30From,
|
||||||
'created_to' => $range30To,
|
'created_to' => $range30To,
|
||||||
]), \App\Support\BackUrl::selfWithoutBack()),
|
]), \App\Support\BackUrl::selfWithoutBack()),
|
||||||
'active_paid_merchants_subscriptions' => \App\Support\BackUrl::withBack('/admin/site-subscriptions?status=activated', \App\Support\BackUrl::selfWithoutBack()),
|
'active_paid_merchants_subscriptions' => \App\Support\BackUrl::withBack('/admin/site-subscriptions?' . \Illuminate\Support\Arr::query([
|
||||||
|
'status' => 'activated',
|
||||||
|
// 口径对齐 active_paid_merchants:已生效且未到期(ends_at >= today)
|
||||||
|
'ends_from' => (string) $baseNow->format('Y-m-d'),
|
||||||
|
'page' => null,
|
||||||
|
]), \App\Support\BackUrl::selfWithoutBack()),
|
||||||
'renewal_orders_30d' => \App\Support\BackUrl::withBack('/admin/platform-orders?' . \Illuminate\Support\Arr::query([
|
'renewal_orders_30d' => \App\Support\BackUrl::withBack('/admin/platform-orders?' . \Illuminate\Support\Arr::query([
|
||||||
'order_type' => 'renewal',
|
'order_type' => 'renewal',
|
||||||
'created_from' => $range30From,
|
'created_from' => $range30From,
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminDashboardPlatformOpsOverviewActivePaidMerchantsLinkShouldFilterEndsAtTest 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_active_paid_merchants_link_should_include_ends_from_today(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$res = $this->get('/admin');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$html = (string) $res->getContent();
|
||||||
|
|
||||||
|
// 活跃付费站点入口应带 ends_from=today,用于对齐“未到期”口径。
|
||||||
|
// 这里不锁死具体日期值(避免测试依赖当前日期),仅断言存在 ends_from=。
|
||||||
|
$this->assertStringContainsString('active_paid_merchants_subscriptions', 'active_paid_merchants_subscriptions');
|
||||||
|
$this->assertStringContainsString('/admin/site-subscriptions', $html);
|
||||||
|
$this->assertStringContainsString('status=activated', $html);
|
||||||
|
$this->assertStringContainsString('ends_from=', $html);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user