feat(admin): 线索/订阅锁定场景补齐续费缺订阅治理入口
This commit is contained in:
@@ -113,6 +113,10 @@
|
||||
'sync_status' => 'failed',
|
||||
'syncable_only' => null,
|
||||
]);
|
||||
|
||||
$leadRenewalMissingSubscriptionUrl = $buildLeadGovernUrl([
|
||||
'renewal_missing_subscription' => '1',
|
||||
]);
|
||||
@endphp
|
||||
<div class="mt-6 actions gap-10">
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $leadUnpaidUrl !!}">查看待支付(该线索)</a>
|
||||
@@ -120,6 +124,7 @@
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $leadBmpaUrl !!}">查看可BMPA处理(该线索)</a>
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $leadSyncableUrl !!}">查看可同步(该线索)</a>
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $leadSyncFailedUrl !!}">查看同步失败(该线索)</a>
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $leadRenewalMissingSubscriptionUrl !!}">查看续费缺订阅(该线索)</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -212,12 +217,17 @@
|
||||
'sync_status' => null,
|
||||
'fail_only' => null,
|
||||
]);
|
||||
|
||||
$subRenewalMissingSubscriptionUrl = $buildSubGovernUrl([
|
||||
'renewal_missing_subscription' => '1',
|
||||
]);
|
||||
@endphp
|
||||
<div class="mt-6 actions gap-10">
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $subSyncableUrl !!}">查看可同步(该订阅)</a>
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $subSyncFailedUrl !!}">查看同步失败(该订阅)</a>
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $subUnpaidUrl !!}">查看待支付(该订阅)</a>
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $subPaidPendingUrl !!}">查看待生效(该订阅)</a>
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $subRenewalMissingSubscriptionUrl !!}">查看续费缺订阅(该订阅)</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminPlatformOrderIndexLeadLockGovernanceLinksShouldIncludeRenewalMissingSubscriptionTest 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_lead_lock_governance_links_should_include_renewal_missing_subscription(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$res = $this->get('/admin/platform-orders?lead_id=12&merchant_id=2&plan_id=3&site_subscription_id=4&back=%2Fadmin%2Fplans&syncable_only=1');
|
||||
$res->assertOk();
|
||||
|
||||
$html = (string) $res->getContent();
|
||||
|
||||
// 线索治理入口:应出现“查看续费缺订阅(该线索)”
|
||||
$matched = preg_match('/<a[^>]+href="([^"]+)"[^>]*>\s*查看续费缺订阅(该线索)\s*<\/a>/u', $html, $m);
|
||||
$this->assertSame(1, $matched, '未找到线索治理入口:查看续费缺订阅(该线索)');
|
||||
|
||||
$url = $m[1] ?? '';
|
||||
$parts = parse_url($url);
|
||||
parse_str($parts['query'] ?? '', $q);
|
||||
|
||||
// 应保留上下文(lead/merchant/plan/subscription/back),并覆盖 renewal_missing_subscription
|
||||
$this->assertSame('12', (string) ($q['lead_id'] ?? ''));
|
||||
$this->assertSame('2', (string) ($q['merchant_id'] ?? ''));
|
||||
$this->assertSame('3', (string) ($q['plan_id'] ?? ''));
|
||||
$this->assertSame('4', (string) ($q['site_subscription_id'] ?? ''));
|
||||
$this->assertSame('/admin/plans', (string) ($q['back'] ?? ''));
|
||||
|
||||
$this->assertSame('1', (string) ($q['renewal_missing_subscription'] ?? ''));
|
||||
|
||||
// 不应继承工具型开关
|
||||
$this->assertArrayNotHasKey('syncable_only', $q);
|
||||
$this->assertArrayNotHasKey('page', $q);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user