线索页补充已付无回执治理入口

This commit is contained in:
萝卜
2026-03-18 22:03:28 +08:00
parent aa583e2b72
commit 9a3ab559fd
2 changed files with 64 additions and 0 deletions

View File

@@ -217,9 +217,17 @@
'renewal_missing_subscription' => '1', 'renewal_missing_subscription' => '1',
'back' => $selfWithoutBack, 'back' => $selfWithoutBack,
]); ]);
$viewPaidNoReceiptOrdersUrl = '/admin/platform-orders?' . \Illuminate\Support\Arr::query([
'lead_id' => $l->id,
'payment_status' => 'paid',
'receipt_status' => 'none',
'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> <a class="btn-secondary btn-sm" href="{!! $viewRenewalMissingSubOrdersUrl !!}">续费缺订阅</a>
<a class="btn-secondary btn-sm" href="{!! $viewPaidNoReceiptOrdersUrl !!}">已付无回执</a>
</div> </div>
</td> </td>
</tr> </tr>

View File

@@ -0,0 +1,56 @@
<?php
namespace Tests\Feature;
use App\Models\Plan;
use App\Models\PlatformLead;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformLeadIndexShouldIncludePaidNoReceiptGovernanceLinkTest 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_paid_no_receipt_governance_link(): void
{
$this->loginAsPlatformAdmin();
$plan = Plan::query()->create([
'code' => 'lead_index_paid_no_receipt_plan',
'name' => '线索页已付无回执治理入口测试套餐',
'billing_cycle' => 'monthly',
'price' => 99,
'list_price' => 99,
'status' => 'active',
'sort' => 10,
'published_at' => now(),
]);
$lead = PlatformLead::query()->create([
'name' => '线索已付无回执测试',
'mobile' => '13900000001',
'email' => 'lead-paid-no-receipt@example.com',
'company' => '线索治理测试公司',
'plan_id' => $plan->id,
'source' => 'web',
'status' => 'new',
]);
$res = $this->get('/admin/platform-leads');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('已付无回执', $html);
$this->assertStringContainsString('/admin/platform-orders?lead_id=' . $lead->id . '&payment_status=paid&receipt_status=none&back=' . urlencode('/admin/platform-leads'), $html);
}
}