SiteSubscription index: renewal create links carry require_subscription flag
This commit is contained in:
@@ -233,6 +233,7 @@
|
|||||||
@php
|
@php
|
||||||
$q = [
|
$q = [
|
||||||
'order_type' => 'renewal',
|
'order_type' => 'renewal',
|
||||||
|
'require_subscription' => '1',
|
||||||
];
|
];
|
||||||
if ((int) ($filters['merchant_id'] ?? 0) > 0) {
|
if ((int) ($filters['merchant_id'] ?? 0) > 0) {
|
||||||
$q['merchant_id'] = (int) $filters['merchant_id'];
|
$q['merchant_id'] = (int) $filters['merchant_id'];
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminSiteSubscriptionIndexCreateRenewalOrderKeepsFiltersShouldCarryRequireSubscriptionFlagTest 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_create_renewal_order_keeps_filters_link_should_carry_require_subscription_flag(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$res = $this->get('/admin/site-subscriptions?' . Arr::query([
|
||||||
|
'merchant_id' => 2,
|
||||||
|
'plan_id' => 3,
|
||||||
|
'status' => 'activated',
|
||||||
|
]));
|
||||||
|
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$res->assertSee('创建续费订单(带当前筛选)', false);
|
||||||
|
$res->assertSee('require_subscription=1', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user