套餐页补充已付无回执治理入口
This commit is contained in:
@@ -268,6 +268,11 @@
|
|||||||
'plan_id' => $plan->id,
|
'plan_id' => $plan->id,
|
||||||
'renewal_missing_subscription' => '1',
|
'renewal_missing_subscription' => '1',
|
||||||
]);
|
]);
|
||||||
|
$paidNoReceiptUrl = $makePlatformOrderUrl([
|
||||||
|
'plan_id' => $plan->id,
|
||||||
|
'payment_status' => 'paid',
|
||||||
|
'receipt_status' => 'none',
|
||||||
|
]);
|
||||||
@endphp
|
@endphp
|
||||||
<div class="actions gap-10">
|
<div class="actions gap-10">
|
||||||
<a href="{!! $editPlanUrl !!}" class="btn btn-secondary btn-sm">编辑</a>
|
<a href="{!! $editPlanUrl !!}" class="btn btn-secondary btn-sm">编辑</a>
|
||||||
@@ -277,6 +282,7 @@
|
|||||||
<span class="muted muted-xs">未启用:不建议下单</span>
|
<span class="muted muted-xs">未启用:不建议下单</span>
|
||||||
@endif
|
@endif
|
||||||
<a href="{!! $renewalMissingSubscriptionUrl !!}" class="btn btn-secondary btn-sm">续费缺订阅</a>
|
<a href="{!! $renewalMissingSubscriptionUrl !!}" class="btn btn-secondary btn-sm">续费缺订阅</a>
|
||||||
|
<a href="{!! $paidNoReceiptUrl !!}" class="btn btn-secondary btn-sm">已付无回执</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" action="/admin/plans/{{ $plan->id }}/set-status" class="mt-6 actions gap-10" data-action="disable-on-submit">
|
<form method="post" action="/admin/plans/{{ $plan->id }}/set-status" class="mt-6 actions gap-10" data-action="disable-on-submit">
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use App\Models\Plan;
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminPlanIndexPaidNoReceiptGovernanceLinkTest 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_plan_index_should_render_paid_no_receipt_governance_link(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$plan = Plan::query()->create([
|
||||||
|
'code' => 'plan_index_paid_no_receipt_link',
|
||||||
|
'name' => '套餐页已付无回执治理入口测试套餐',
|
||||||
|
'billing_cycle' => 'monthly',
|
||||||
|
'price' => 99,
|
||||||
|
'list_price' => 99,
|
||||||
|
'status' => 'active',
|
||||||
|
'sort' => 10,
|
||||||
|
'published_at' => now(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$res = $this->get('/admin/plans');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$html = (string) $res->getContent();
|
||||||
|
$this->assertStringContainsString('已付无回执', $html);
|
||||||
|
|
||||||
|
$expectedBack = urlencode('/admin/plans');
|
||||||
|
$this->assertStringContainsString('/admin/platform-orders?plan_id=' . $plan->id . '&payment_status=paid&receipt_status=none&back=' . $expectedBack, $html);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user