feat(admin): 线索列表补齐续费缺订阅治理入口(按 lead_id)
This commit is contained in:
@@ -161,8 +161,15 @@
|
|||||||
'lead_id' => $l->id,
|
'lead_id' => $l->id,
|
||||||
'back' => $selfWithoutBack,
|
'back' => $selfWithoutBack,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$viewRenewalMissingSubOrdersUrl = '/admin/platform-orders?' . \Illuminate\Support\Arr::query([
|
||||||
|
'lead_id' => $l->id,
|
||||||
|
'renewal_missing_subscription' => '1',
|
||||||
|
'back' => $selfWithoutBack,
|
||||||
|
]);
|
||||||
@endphp
|
@endphp
|
||||||
<a class="btn-secondary btn-sm" href="{!! $viewOrdersUrl !!}">查看订单</a>
|
<a class="btn-secondary btn-sm" href="{!! $viewOrdersUrl !!}">查看订单</a>
|
||||||
|
<a class="btn-secondary btn-sm" href="{!! $viewRenewalMissingSubOrdersUrl !!}">续费缺订阅</a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use App\Models\Plan;
|
||||||
|
use App\Models\PlatformLead;
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminPlatformLeadIndexShouldIncludeRenewalMissingSubscriptionGovernanceLinkTest 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_platform_lead_index_should_include_renewal_missing_subscription_governance_link(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$plan = Plan::query()->create([
|
||||||
|
'code' => 'lead_index_rms_link_plan',
|
||||||
|
'name' => '线索页续费缺订阅治理入口测试套餐',
|
||||||
|
'billing_cycle' => 'monthly',
|
||||||
|
'price' => 10,
|
||||||
|
'list_price' => 10,
|
||||||
|
'status' => 'active',
|
||||||
|
'sort' => 10,
|
||||||
|
'published_at' => now(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$lead = PlatformLead::query()->create([
|
||||||
|
'status' => 'new',
|
||||||
|
'name' => '张三',
|
||||||
|
'mobile' => '13800000000',
|
||||||
|
'email' => 'zs@example.com',
|
||||||
|
'company' => '测试公司',
|
||||||
|
'plan_id' => $plan->id,
|
||||||
|
'source' => 'test',
|
||||||
|
'meta' => [],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$res = $this->get('/admin/platform-leads');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$html = (string) $res->getContent();
|
||||||
|
|
||||||
|
// 应出现“续费缺订阅”按钮,并携带 lead_id + renewal_missing_subscription=1 + back 回线索页
|
||||||
|
$this->assertStringContainsString('续费缺订阅', $html);
|
||||||
|
$this->assertStringContainsString('/admin/platform-orders?lead_id=' . $lead->id, $html);
|
||||||
|
$this->assertStringContainsString('renewal_missing_subscription=1', $html);
|
||||||
|
$this->assertStringContainsString('back=' . urlencode('/admin/platform-leads'), $html);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user